API Docs for: 5.4.0-alpha.78+806d39aa
Show:

PromiseManyArray Class

This class is returned as the result of accessing an async hasMany relationship on an instance of a Model extending from @ember-data/model.

A PromiseManyArray is an iterable proxy that allows templates to consume related ManyArrays and update once their contents are no longer pending.

In your JS code you should resolve the promise first.

const comments = await post.comments;

Methods

catch

(
  • callback
)
public

catch errors thrown by this promise

Parameters:

  • callback Object

Returns:

Promise

finally

(
  • callback
)
public

run cleanup after this promise completes

Parameters:

  • callback Object

Returns:

Promise

forEach

(
  • cb
)
private

Iterate the proxied content. Called by the glimmer iterator in #each We do not guarantee that forEach will always be available. This may eventually be made to use Symbol.Iterator once glimmer supports it.

Parameters:

  • cb Object

Returns:

reload

(
  • options
)
public

Reload the relationship

Parameters:

  • options Object

Returns:

then

(
  • success
  • fail
)
public

chain this promise

Parameters:

  • success Object
  • fail Object

Returns:

Promise

Properties

isFulfilled

Boolean public

Whether the loading promise succeeded

isPending

Boolean public

Whether the loading promise is still pending

isRejected

Boolean public

Whether the loading promise rejected

isSettled

Boolean public

Whether the loading promise completed (resolved or rejected)

length

Unknown public

Retrieve the length of the content

meta

Unknown public

Retrieve the meta for this relationship