Created
November 28, 2018 20:42
-
-
Save mvbattan/6fffb2f73b9dd05925fee7da41a6b543 to your computer and use it in GitHub Desktop.
Common 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 '../../creators/createReducer'; | |
import onLoading from '../../effects/onLoading'; | |
import onSuccess from '../../effects/onSuccess'; | |
import onFailure from '../../effects/onFailure'; | |
// TODO: Let the user specify selectors | |
const reducerDescription = { | |
LOADING: onLoading(), | |
SUCCESS: onSuccess(), | |
FAILURE: onFailure() | |
}; | |
export const defaultActionNames = Object.keys(reducerDescription); | |
// TODO: Let user specify this initialState | |
export default createReducer({}, reducerDescription); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment