Skip to content

Commit

Permalink
Don't make duplicated requests through Ember Data
Browse files Browse the repository at this point in the history
ember-data-storefront provides FastbootAdapter which caches XHRs in
Fastboot's Shoebox.

This will prevent duplicated requests on /crates and other
Ember Data-powered pages.
  • Loading branch information
kzys committed Jan 4, 2020
1 parent e218804 commit a38f038
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 233 deletions.
5 changes: 3 additions & 2 deletions app/adapters/application.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import RESTAdapter from '@ember-data/adapter/rest';
import { inject as service } from '@ember/service';
import { computed } from '@ember/object';
import FastbootAdapter from 'ember-data-storefront/mixins/fastboot-adapter';

export default RESTAdapter.extend({
fastboot: service(),
export default RESTAdapter.extend(FastbootAdapter, {
fetcher: service(),

namespace: 'api/v1',

Expand Down
Loading

0 comments on commit a38f038

Please sign in to comment.