2018-10-01から1ヶ月間の記事一覧
知見 fetchでthenな感じのやつはasync awaitな感じで書くといいらしい const getFirstUserData = () => { return fetch('/users.json') // ユーザ一覧のJSONを取得 .then(response => response.json()) // パース .then(users => users[0]) // 最初のユーザ…
知見 fetchでthenな感じのやつはasync awaitな感じで書くといいらしい const getFirstUserData = () => { return fetch('/users.json') // ユーザ一覧のJSONを取得 .then(response => response.json()) // パース .then(users => users[0]) // 最初のユーザ…