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;
Item Index
Properties
Methods
catch
-
callback
catch errors thrown by this promise
Parameters:
-
callback
Object
Returns:
Promise
finally
-
callback
run cleanup after this promise completes
Parameters:
-
callback
Object
Returns:
Promise
forEach
-
cb
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
Reload the relationship
Parameters:
-
options
Object
Returns:
then
-
success
-
fail
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
links
Unknown
public
Retrieve the links for this relationship
meta
Unknown
public
Retrieve the meta for this relationship