Created
April 3, 2017 21:23
-
-
Save carlosble/1f78f0ef6e198c637a91e9ace3ebb2d2 to your computer and use it in GitHub Desktop.
Action creator that combines async request to the server
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 * as types from '../constants/actionTypes'; | |
export function loadProfile(serverApi) { | |
return function (dispatch) { | |
return serverApi.getProfile().then((json) => { | |
return dispatch({ | |
type: types.GET_PROFILE, | |
profile: json | |
}); | |
}); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment