Skip to content

Instantly share code, notes, and snippets.

@furkanedu
furkanedu / redux.js
Last active September 4, 2019 11:37
Example redux file with constants, reducer and actions
const namespace = 'shoud_be_unique_for_each_reducer'
const MERGE_REDUX_STATE_WITH = `${namespace}---MERGE_REDUX_STATE_WITH`
const RESET_REDUX_STATE = `${namespace}---RESET_REDUX_STATE`
const initialState = {}
export default function reducer(state = initialState, action) {
switch(action.type) {
case MERGE_REDUX_STATE_WITH: