Created
August 14, 2017 23:25
-
-
Save bjonnh/5bff686fb7ac215a1cc48cb541179af3 to your computer and use it in GitHub Desktop.
This file contains 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 { combineReducers } from 'redux'; | |
import { createReducer } from 'redux-act'; | |
import { | |
emails_data | |
} from './actions'; | |
const initial = { | |
email: { | |
unread: 0 | |
}, | |
}; | |
const email = createReducer({ | |
[emails_data]: (state, payload) => { | |
if (payload['type'] === "UNREAD_EMAILS") | |
{ | |
return { | |
...state, | |
unread: payload['emails'] | |
} | |
} | |
} | |
}, initial.email); | |
export default combineReducers( | |
{ email } | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment