import fetch from 'isomorphic-unfetch' ; export const fetchAPI = async ( info , init ? ) => { const response = await fetch ( info , init ) ; if ( response . ok ) { return response . json ( ) ; } const text = await response . text ( ) ; throw new Error ( text ) ; } ;