Skip to content

Commit a8c37cf

Browse files
committed
Don't make duplicated requests through Ember Data
ember-data-storefront provides FastbootAdapter which caches Ajax requests' resulets in Fastboot's Shoebox. So all requests it made in the FastBoot server won't be issued again from the browser. This will prevent duplicated requests on `/crates` and other Ember Data-powered pages.
1 parent e218804 commit a8c37cf

File tree

3 files changed

+83
-232
lines changed

3 files changed

+83
-232
lines changed

app/adapters/application.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import RESTAdapter from '@ember-data/adapter/rest';
22
import { inject as service } from '@ember/service';
33
import { computed } from '@ember/object';
4+
import FastbootAdapter from 'ember-data-storefront/mixins/fastboot-adapter';
45

5-
export default RESTAdapter.extend({
6+
export default RESTAdapter.extend(FastbootAdapter, {
67
fastboot: service(),
78

89
namespace: 'api/v1',

0 commit comments

Comments
 (0)