insomnia/app/redux/modules/global.js
Gregory Schier f90e4d7419 Started on hotkeys (#19)
* Started on hotkeys

* Tweaks

* Changed tab color

* Persist sidebarWidth to workspace

* Tweaks

* Switched to Mousetrap
2016-07-06 13:18:26 -07:00

40 lines
664 B
JavaScript

const LOAD_START = 'global/load-start';
const LOAD_STOP = 'global/load-stop';
const SIDEBAR_RESIZE = 'global/sidebar-resize';
const initialState = {
loading: false
};
// ~~~~~~~~ //
// REDUCERS //
// ~~~~~~~~ //
export default function (state = initialState, action) {
switch (action.type) {
case LOAD_START:
return Object.assign({}, state, {loading: true});
case LOAD_STOP:
return Object.assign({}, state, {loading: false});
default:
return state;
}
}
// ~~~~~~~ //
// ACTIONS //
// ~~~~~~~ //
export function loadStart () {
return {type: LOAD_START};
}
export function loadStop () {
return {type: LOAD_STOP};
}