UNPKG

@gdwc/drupal-state

Version:

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

14 lines (8 loc) 490 B
'use strict'; var a = require('isomorphic-fetch'); function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } var a__default = /*#__PURE__*/_interopDefault(a); var c=(t,o={},r)=>a__default.default(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; module.exports = l;