How to use the ember-data-storefront/-private/utils/get-key.shoeboxize function in ember-data-storefront

To help you get started, we’ve selected a few ember-data-storefront examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github embermap / ember-data-storefront / addon / mixins / fastboot-adapter.js View on Github external
_getStorefrontBoxedQuery(type, url, params) {
    let payload;
    let fastboot = this.get('fastboot');
    let isFastboot = fastboot && fastboot.get('isFastBoot');
    let shoebox = fastboot && fastboot.get('shoebox');
    let box = shoebox && shoebox.retrieve('ember-data-storefront');

    if (!isFastboot && box && box.queries && Object.keys(box.queries).length > 0) {
      let key = shoeboxize(cacheKey([type, url.replace(/^.*\/\/[^\/]+/, ''), params]));
      payload = box.queries[key];
      delete box.queries[key];
    }

    return payload;
  }