insomnia/app/redux/modules/workspaces.js
Gregory Schier 0f832e55da Small refactor (#36)
* Some stuff

* Remove Mashape reference
2016-09-02 22:14:48 -07:00

33 lines
580 B
JavaScript

import {combineReducers} from 'redux';
import {MODAL_WORKSPACE_RENAME} from '../../lib/constants';
export const WORKSPACE_ACTIVATE = 'workspaces/activate';
// ~~~~~~~~ //
// REDUCERS //
// ~~~~~~~~ //
function activeReducer (state = null, action) {
switch (action.type) {
case WORKSPACE_ACTIVATE:
return action.workspace._id;
default:
return state;
}
}
export default combineReducers({
activeId: activeReducer
});
// ~~~~~~~ //
// ACTIONS //
// ~~~~~~~ //
export function activate (workspace) {
return {type: WORKSPACE_ACTIVATE, workspace};
}