November 2017
Beginner to intermediate
398 pages
8h 42m
English
Finally, we could manage the errors that could occur for any resource request:
// Initialize data properties initData.remoteErrors = {} for (const key in resources) { initData[key] = null initData.remoteErrors[key] = null }
The key of the remoteErrors object will be the same as the resource, and the value will be the error or null if there is no error.
Next, we need to modify the fetchResource method:
async fetchResource ...
Read now
Unlock full access