September 2018
Intermediate to advanced
302 pages
7h 17m
English
Currently, we have a default task list being loaded from the file in taskReducer.js. To be honest, loading from either the file or API can be time consuming. It will be better initially to set the task list to empty the array and provide feedback to the user with a spinner or text message, informing them that the data is being loaded. We will implement this along with the change to the Fetch API.
First, remove data import from the file in the reducer. Change the declaration from the following:
(state = Immutable.List([...data.tasks]), action) => { // ...}
And replace it with the code in this snippet:
(state = Immutable.List([]), action) => { // ...}
Read now
Unlock full access