-
-
Save xnimorz/3cd1ceffc571237d04a6c7d2affbc1a4 to your computer and use it in GitHub Desktop.
typical reducer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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