Skip to content

Instantly share code, notes, and snippets.

@nparsons08 nparsons08/reducer.js Secret forked from LukeSmetham/reducer.js
Created Sep 24, 2019

Embed
What would you like to do?
import { SET_UNREAD_COUNT } from './types';
const init = {
unread: 0,
};
export default (state = init, action) => {
switch (action.type) {
case SET_UNREAD_COUNT:
return { ...state, unread: action.count };
default:
return state;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.