Skip to content

Instantly share code, notes, and snippets.

@Jared-Dahlke
Last active September 26, 2019 07:06
Show Gist options
  • Select an option

  • Save Jared-Dahlke/3e85694bfe2ccea5fe8c4b6718affc61 to your computer and use it in GitHub Desktop.

Select an option

Save Jared-Dahlke/3e85694bfe2ccea5fe8c4b6718affc61 to your computer and use it in GitHub Desktop.
import { createStore} from 'redux'
const defaultState = {
AlertCount: null
};
function chatStore(state=defaultState, action) {
switch(action.type) {
case "SetAlertCount":
return {...state,
AlertCount: action.payload.AlertCount
};
default:
return state;
}
}
export default createStore(chatStore);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment