mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-01-19 19:25:52 +08:00
27 lines
490 B
TypeScript
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;
|