CommentOct 11, 20181
This is great, and I use this in my own async action creators. One thing that should be added is checking for a 404 or 500 response, because fetch() won't throw an error if the request succeeded, regardless of the response. So the lines making the fetch call and parsing the data would look like this: const response = await fetch( ` ${API_SERVER} /speakers` ); if (!response.ok) { throw new Error (response.statusText || 'Invalid response' ); } const speakers = await response.json(); See this site for a longer explanation