UNPKG

@gdwc/drupal-state

Version:

A simple data store to manage application state sourced from Drupal's JSON:API.

8 lines (5 loc) 319 B
import i from 'isomorphic-fetch'; var a=(r,t={},o)=>i(r,t),s=a;var d=(r,t=s,o=n=>{throw n})=>t(r).then(e=>{if(!e.ok)throw new Error(`Failed to fetch API index. Tried fetching: ${r} Server responded with status code: ${e.status}`);return e.json()}).then(e=>e.links||!1).catch(e=>{o(e);}),h=d; export { h as default };