Created
March 14, 2017 14:56
-
-
Save brakmic/6a30b18b9f89cd03d7b865ea061d60af to your computer and use it in GitHub Desktop.
vr module reducer
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 vrModuleReducer: ActionReducer<IVrModule[]> = (state: IVrModule[] = | |
initialState, action: Action) => { | |
switch (action.type) { | |
case VR_MODULE_REMOVED: | |
return _.filter(state, (mod) => mod.id === action.payload.id); | |
case VR_MODULE_ADDED: | |
return _.concat(state, action.payload); | |
default: | |
return state; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment