File size: 613 Bytes
f2bee8a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
};