August 2017
Beginner
374 pages
10h 41m
English
We start by writing an action creator that fetches a single user object by username; we can use our thunkCreator utility function here:
// ...other action types...// usersexport const FETCH_USER_REQUEST = 'FETCH_USER_REQUEST'export const FETCH_USER_SUCCESS = 'FETCH_USER_SUCCESS'export const FETCH_USER_FAILURE = 'FETCH_USER_FAILURE'// ...other user related action types...// ...other action types...
import { thunkCreator } from './utils'
import { FETCH_USER_REQUEST, FETCH_USER_SUCCESS, FETCH_USER_FAILURE, ...Read now
Unlock full access