Creating Reusable Mocks
Now that you know how to use libraries and prebuilt mocks, it is time for us to develop our own mocks.
We'll cover the following...
Interfacing components with API: useTasks hook
Though we have our API helpers written, this is not enough to make tasks persistent. In order to connect the React components and the underlying API functions, create a useTasks hook, which would take the responsibility of polling and updating tasks.
We want it to:
- Request the list of tasks on the render.
- Make them
Ask