mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 23:00:30 +00:00
f90e4d7419
* Started on hotkeys * Tweaks * Changed tab color * Persist sidebarWidth to workspace * Tweaks * Switched to Mousetrap
40 lines
664 B
JavaScript
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};
|
|
}
|