October 2019
Intermediate to advanced
426 pages
11h 49m
English
The next step is defining an asynchronous action creator for the fetchTodos action. Here, we are going to use the async/await construct.
We are now going to use an async function to define the fetchTodos action creator:
import { FETCH_TODOS, ADD_TODO, TOGGLE_TODO, REMOVE_TODO, FILTER_TODOS} from './actionTypes'import { fetchAPITodos } from './api'
export function fetchTodos () { return async (dispatch) => {
Read now
Unlock full access