Skip to content

Commit

Permalink
reduce inter-dependency by moving proxyToContent
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Nov 30, 2019
1 parent ebc5e50 commit 8bd36ba
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 7 additions & 1 deletion packages/model/addon/-private/system/promise-many-array.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { reads } from '@ember/object/computed';
import { Promise } from 'rsvp';
import { assert } from '@ember/debug';
import { FULL_LINKS_ON_RELATIONSHIPS } from '@ember-data/canary-features';
import { PromiseArray, proxyToContent } from '@ember-data/store/-private';
import { PromiseArray } from '@ember-data/store/-private';

/**
@module @ember-data/model
Expand Down Expand Up @@ -48,3 +48,9 @@ export function promiseManyArray(promise, label) {
promise: Promise.resolve(promise, label),
});
}

function proxyToContent(method) {
return function() {
return get(this, 'content')[method](...arguments);
};
}
2 changes: 1 addition & 1 deletion packages/store/addon/-private/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export { errorsHashToArray, errorsArrayToHash } from './system/errors-utils';
export { default as RootState } from './system/model/states';
export { default as InternalModel } from './system/model/internal-model';

export { PromiseArray, PromiseObject, proxyToContent } from './system/promise-proxies';
export { PromiseArray, PromiseObject } from './system/promise-proxies';

export { RecordArray, AdapterPopulatedRecordArray } from './system/record-arrays';

Expand Down
6 changes: 0 additions & 6 deletions packages/store/addon/-private/system/promise-proxies.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,3 @@ export function promiseArray(promise, label) {
promise: Promise.resolve(promise, label),
});
}

export function proxyToContent(method) {
return function() {
return get(this, 'content')[method](...arguments);
};
}

0 comments on commit 8bd36ba

Please sign in to comment.