Skip to content

Instantly share code, notes, and snippets.

@bjonnh
Created August 14, 2017 22:44
Show Gist options
  • Save bjonnh/98ab61a048ac9a3b62049a215900a49a to your computer and use it in GitHub Desktop.
Save bjonnh/98ab61a048ac9a3b62049a215900a49a to your computer and use it in GitHub Desktop.
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