How to use the @ember-data/store/-private.PromiseArray.extend function in @ember-data/store

To help you get started, we’ve selected a few @ember-data/store 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 emberjs / data / packages / model / addon / -private / system / promise-many-array.js View on Github external
to the underlying manyArray.
  Right now we proxy:

    * `reload()`
    * `createRecord()`
    * `on()`
    * `one()`
    * `trigger()`
    * `off()`
    * `has()`

  @class PromiseManyArray
  @extends Ember.ArrayProxy
  @private
*/
const PromiseManyArray = PromiseArray.extend({
  links: FULL_LINKS_ON_RELATIONSHIPS ? reads('content.links') : undefined,
  reload(options) {
    assert('You are trying to reload an async manyArray before it has been created', get(this, 'content'));
    this.set('promise', this.get('content').reload(options));
    return this;
  },
  createRecord: proxyToContent('createRecord'),
  on: proxyToContent('on'),
  one: proxyToContent('one'),
  trigger: proxyToContent('trigger'),
  off: proxyToContent('off'),
  has: proxyToContent('has'),
});

export default PromiseManyArray;