Last active
November 23, 2016 20:42
-
-
Save shotaK/07b3740d162c22c96a80a126460d8b65 to your computer and use it in GitHub Desktop.
Redux Immutable JS
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
import { | |
ACTIVATE_LOCATION | |
} from './actions'; | |
import Immutable from 'immutable'; | |
let initialState = Immutable.Map([]); | |
export let ui = (state = initialState, action) => { | |
switch (action.type) { | |
case ACTIVATE_LOCATION: | |
state = state.set('activeLocationId', action.id); | |
break; | |
} | |
return state; | |
}; |
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
import { | |
ACTIVATE_LOCATION | |
} from './actions'; | |
import { Map } from 'immutable'; | |
const initialState = Map({}) | |
export let ui = (state = initialState, action) => { | |
switch (action.type) { | |
case ACTIVATE_LOCATION: | |
return state.set('activeLocationId', action.id); | |
default: | |
return state; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment