@gdwc/drupal-state
Version:
A simple data store to manage application state sourced from Drupal's JSON:API.
8 lines (5 loc) • 328 B
JavaScript
import a from 'isomorphic-fetch';
var c=(t,o={},r)=>a(t,o),s=c;var f=(t,o={},r=n=>{throw n},p,i=s)=>i(t,o,p).then(e=>{if(!e.ok)throw new Error(`Failed to fetch JSON:API endpoint.
Tried fetching: ${t}
Server responded with status code: ${e.status}`);return e.json()}).then(e=>e).catch(e=>{r(e);}),l=f;
export { l as default };