2016-07-06 20:18:26 +00:00
|
|
|
const LOAD_START = 'global/load-start';
|
|
|
|
const LOAD_STOP = 'global/load-stop';
|
|
|
|
const SIDEBAR_RESIZE = 'global/sidebar-resize';
|
2016-04-23 06:08:52 +00:00
|
|
|
|
|
|
|
const initialState = {
|
|
|
|
loading: false
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// ~~~~~~~~ //
|
|
|
|
// REDUCERS //
|
|
|
|
// ~~~~~~~~ //
|
|
|
|
|
|
|
|
export default function (state = initialState, action) {
|
|
|
|
switch (action.type) {
|
|
|
|
|
2016-07-06 20:18:26 +00:00
|
|
|
case LOAD_START:
|
2016-04-23 06:08:52 +00:00
|
|
|
return Object.assign({}, state, {loading: true});
|
|
|
|
|
2016-07-06 20:18:26 +00:00
|
|
|
case LOAD_STOP:
|
2016-04-23 06:08:52 +00:00
|
|
|
return Object.assign({}, state, {loading: false});
|
|
|
|
|
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ~~~~~~~ //
|
|
|
|
// ACTIONS //
|
|
|
|
// ~~~~~~~ //
|
|
|
|
|
|
|
|
export function loadStart () {
|
2016-07-06 20:18:26 +00:00
|
|
|
return {type: LOAD_START};
|
2016-04-23 06:08:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export function loadStop () {
|
2016-07-06 20:18:26 +00:00
|
|
|
return {type: LOAD_STOP};
|
2016-04-23 06:08:52 +00:00
|
|
|
}
|