Created
June 2, 2018 05:41
-
-
Save selbekk/a0d9985121f7f695d6c1101f2a8f3308 to your computer and use it in GitHub Desktop.
A simple dispatcher
This file contains hidden or 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 * as actions from '../actions'; | |
| const getUser = () => async dispatch => { | |
| dispatch(actions.getUserRequested()); | |
| const response = await fetch('/api/user'); | |
| const user = await response.json(); | |
| dispatch(actions.getUserReceived(user); | |
| }; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment