7. Fetch
Until now ShippingBoard imported its customers and ramps as JSON files. In our apps the data lives in SAP, and the frontend asks ABAP REST services for it. Normally the API is on the same domain as the web app, so the base URL can be /api/. We don't have SAP here, so we get the same JSON files from GitHub.
We ask for them first with await, then with then. At the end we fix the store, so the user can tell "no ramps" from "no answer".
Lessons
Lessons 7.1–7.3 run here in the browser; 7.4 continues on your computer in shippingboard-lite, branch create-fetch.