August 2017
Beginner
374 pages
10h 41m
English
Finally, we define the filter action creators in src/actions/filter.js. These are pretty simple and straightforward:
import { SET_FILTER, CLEAR_FILTER } from '../actionTypes'
export const setFilter = (filter) => {
return {
type: SET_FILTER,
filter,
}
}
export const clearFilter = () => {
return {
type: CLEAR_FILTER,
}
}
Again, we need to export the action creators in our src/actions/index.js file:
export * from './filter'
Read now
Unlock full access