asynqmon/ui/src/reducers/settingsReducer.ts
2020-11-24 21:38:55 -08:00

27 lines
490 B
TypeScript

import {
POLL_INTERVAL_CHANGE,
SettingsActionTypes,
} from "../actions/settingsActions";
interface SettingsState {
pollInterval: number;
}
const initialState: SettingsState = {
pollInterval: 8,
};
function settingsReducer(
state = initialState,
action: SettingsActionTypes
): SettingsState {
switch (action.type) {
case POLL_INTERVAL_CHANGE:
return { ...state, pollInterval: action.value };
default:
return state;
}
}
export default settingsReducer;