import { createReducer } from "redux-act";
import { startSnapshotModeAction, stopSnapshotModeAction, isSignedInAction, setOfflineAction } from "./actions";
export const initialState = {
    isSnapshotMode: false,
    snapshotCharts: null,
    snapshotDataPoints: null,
    isSignedIn: false,
    offline: false
};
export const dashboardReducer = createReducer({}, initialState);
dashboardReducer.on(startSnapshotModeAction, (state, { charts, dataPoints }) => ({
    ...state,
    snapshotCharts: charts,
    snapshotDataPoints: dataPoints,
    isSnapshotMode: true,
}));
dashboardReducer.on(stopSnapshotModeAction, (state) => ({
    ...state,
    isSnapshotMode: initialState.isSnapshotMode,
    snapshotCharts: initialState.snapshotCharts,
    snapshotDataPoints: initialState.snapshotDataPoints,
}));
dashboardReducer.on(isSignedInAction, (state, { isSignedIn }) => ({
    ...state,
    isSignedIn
}));
dashboardReducer.on(setOfflineAction, (state, { offline }) => ({
    ...state,
    offline
}));
//# sourceMappingURL=reducer.js.map