Skip to content

Instantly share code, notes, and snippets.

@bjonnh
Created August 14, 2017 23:25
Show Gist options
  • Save bjonnh/5bff686fb7ac215a1cc48cb541179af3 to your computer and use it in GitHub Desktop.
Save bjonnh/5bff686fb7ac215a1cc48cb541179af3 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")
{
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