October 2019
Intermediate to advanced
426 pages
11h 49m
English
First of all, we are going to define an API that will fetch todo items. In our case, we are simply going to return an array of todo items, after a short delay.
Let's start implementing the mock API:
export const generateID = () => { const S4 = () =>(((1+Math.random())*0x10000)|0).toString(16).substring(1) return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4())}
export const fetchAPITodos = () => new Promise((resolve) => setTimeout(() ...
Read now
Unlock full access