soiz1's picture
Upload 1525 files
f2bee8a verified
raw
history blame contribute delete
613 Bytes
const SET_AUTOSAVE_TIMEOUT_ID = 'timeout/SET_AUTOSAVE_TIMEOUT_ID';
const initialState = {
autoSaveTimeoutId: null
};
const reducer = function (state, action) {
if (typeof state === 'undefined') state = initialState;
switch (action.type) {
case SET_AUTOSAVE_TIMEOUT_ID:
return Object.assign({}, state, {
autoSaveTimeoutId: action.id
});
default:
return state;
}
};
const setAutoSaveTimeoutId = id => ({
type: SET_AUTOSAVE_TIMEOUT_ID,
id
});
export {
reducer as default,
initialState as timeoutInitialState,
setAutoSaveTimeoutId
};