Skip to content

Instantly share code, notes, and snippets.

@xnimorz
Created October 31, 2019 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xnimorz/3cd1ceffc571237d04a6c7d2affbc1a4 to your computer and use it in GitHub Desktop.
Save xnimorz/3cd1ceffc571237d04a6c7d2affbc1a4 to your computer and use it in GitHub Desktop.
typical reducer
import createReducer from 'lux/modules/createReducer';
export const CURRENCIES = 'CURRENCIES';
export const INITIAL_STATE = {
default: null,
list: [],
};
export const currenciesAction = (payload = INITIAL_STATE) => ({
type: CURRENCIES,
payload,
});
export default createReducer(
INITIAL_STATE,
{
[CURRENCIES]: (state, action) => action.payload,
},
currenciesAction
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment