2016-07-16 02:06:10 +00:00
|
|
|
import {combineReducers} from 'redux';
|
|
|
|
import {MODAL_WORKSPACE_RENAME} from '../../lib/constants';
|
2016-04-23 06:08:52 +00:00
|
|
|
|
|
|
|
export const WORKSPACE_ACTIVATE = 'workspaces/activate';
|
|
|
|
|
|
|
|
// ~~~~~~~~ //
|
|
|
|
// REDUCERS //
|
|
|
|
// ~~~~~~~~ //
|
|
|
|
|
|
|
|
function activeReducer (state = null, action) {
|
|
|
|
switch (action.type) {
|
|
|
|
|
2016-04-26 07:29:24 +00:00
|
|
|
case WORKSPACE_ACTIVATE:
|
|
|
|
return action.workspace._id;
|
2016-04-23 06:08:52 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default combineReducers({
|
2016-04-26 07:29:24 +00:00
|
|
|
activeId: activeReducer
|
2016-04-23 06:08:52 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// ~~~~~~~ //
|
|
|
|
// ACTIONS //
|
|
|
|
// ~~~~~~~ //
|
|
|
|
|
2016-04-26 07:29:24 +00:00
|
|
|
export function activate (workspace) {
|
|
|
|
return {type: WORKSPACE_ACTIVATE, workspace};
|
2016-04-23 06:08:52 +00:00
|
|
|
}
|