4 lines
209 B
JavaScript
4 lines
209 B
JavaScript
// @flow
|
|
export default function handleFetchResponse(response: Response): Promise<any> {
|
|
return response.status === 200 ? Promise.resolve(response.json()) : Promise.reject(new Error(response.statusText));
|
|
}
|