August 2017
Beginner
374 pages
10h 41m
English
We start with the user actions, because there is only one action to be defined—creating users:
import { CREATE_USER } from '../actionTypes'
export const createUser = (username, realname) => {
return {
type: CREATE_USER,
username,
realname,
}
}
Now, all that's left to do is export the action creator from the directory.
export * from './users'
Now, we can import the createUser action creator as follows:
import { createUser } from './actions'
Note how ...
Read now
Unlock full access