Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
create(injections = {}) {
// Use `fetch` implementation from `ember-fetch`
Orbit.fetch = fetch;
injections.name = 'remote';
return new JSONAPISource(injections);
}
};
constructor() {
this.currentSchema = currentSchema
this.schema = new Schema(currentSchema)
this.remote = new JSONAPISource({ schema: this.schema, name: 'remote', host: 'http://localhost:5000/api/v2/storefront' })
this.coordinator = new Coordinator()
this.store = new Store({ schema: this.schema, name: 'store' })
this.coordinator.addSource(this.store)
this.coordinator.addSource(this.remote)
this.coordinator.addStrategy(new RequestStrategy({
source: 'store',
on: 'beforeQuery',
target: 'remote',
action: 'pull',
blocking: true
}))
this.coordinator.addStrategy(new SyncStrategy({
source: 'remote',