Created
May 17, 2016 20:30
-
-
Save reharik/10cb998ac74b5d72aa8e2d54872c7954 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const reducers = combineReducers({ | |
routing, | |
chapters: (state = {}) => state, | |
expandChapter | |
}); | |
export default reducers; | |
const expandChapter = (state = {}, action = null) => { | |
if(action.type == EXPAND_CHAPTER) { | |
var item = state[action.id]; | |
return {...item, isExpanded: !item.isExpanded} | |
} | |
return state; | |
}; | |
export { | |
expandChapter | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment