Created
August 14, 2017 22:44
-
-
Save bjonnh/98ab61a048ac9a3b62049a215900a49a 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") | |
{ state.unread = payload['emails']} | |
return { | |
...state | |
} | |
} | |
}, initial.email); | |
export default combineReducers( | |
{ email } | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment