August 2017
Beginner
374 pages
10h 41m
English
We will replace our synchronous createUser action creator with an asynchronous action creator that sends a request to the API. Instead of returning the action object, we will use the thunkCreator utility function we created earlier. We are now going to define the createUser action creator:
export const CREATE_USER = 'CREATE_USER'
Replace it with these three action types:
export const CREATE_USER_REQUEST = 'CREATE_USER_REQUEST'export const CREATE_USER_SUCCESS = 'CREATE_USER_SUCCESS'export const CREATE_USER_FAILURE = 'CREATE_USER_FAILURE'
Read now
Unlock full access