second commit :S
This commit is contained in:
@@ -4,10 +4,11 @@ import { combineReducers } from 'redux';
|
||||
import {
|
||||
UPDATE_TEXT,
|
||||
TOGGLE_EDITORS,
|
||||
TOGGLE_HISTORY_SIDEBAR,
|
||||
ActiveEditors,
|
||||
} from '../Actions';
|
||||
|
||||
function activeEditors(state = [ActiveEditors.MARKDOWN, ActiveEditors.TEXT], action) {
|
||||
const activeEditors = (state = [ActiveEditors.MARKDOWN, ActiveEditors.TEXT], action) => {
|
||||
switch (action.type) {
|
||||
case TOGGLE_EDITORS: {
|
||||
const newState = _.xor(state, [action.toggledEditor]);
|
||||
@@ -22,7 +23,20 @@ function activeEditors(state = [ActiveEditors.MARKDOWN, ActiveEditors.TEXT], act
|
||||
}
|
||||
}
|
||||
|
||||
function text(state = '', action) {
|
||||
const historySidebar = (state = { visible: false }, action) => {
|
||||
switch (action.type) {
|
||||
case TOGGLE_HISTORY_SIDEBAR: {
|
||||
return {
|
||||
...state,
|
||||
visible: !state.visible,
|
||||
};
|
||||
}
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
const text = (state = '', action) => {
|
||||
switch (action.type) {
|
||||
case UPDATE_TEXT:
|
||||
return action.text;
|
||||
@@ -31,9 +45,8 @@ function text(state = '', action) {
|
||||
}
|
||||
}
|
||||
|
||||
const application = combineReducers({
|
||||
export default combineReducers({
|
||||
activeEditors,
|
||||
historySidebar,
|
||||
text,
|
||||
});
|
||||
|
||||
export default application;
|
||||
|
||||
Reference in New Issue
Block a user