Class PromiseManyArray
publicThis 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 array-like proxy that also proxies certain method calls to the underlying ManyArray in addition to being "promisified".
Right now we proxy:
reload()
createRecord()
This promise-proxy behavior is primarily to ensure that async relationship interact nicely with templates. In your JS code you should resolve the promise first.
1 |
const comments = await post.comments; |
catch (callback) public
Defined in ../model/addon/-private/promise-many-array.ts:150
- callback
- returns
- Promise
catch errors thrown by this promise
finally (callback) public
Defined in ../model/addon/-private/promise-many-array.ts:161
- callback
- returns
- Promise
run cleanup after this promise completes
reload (options) public
Defined in ../model/addon/-private/promise-many-array.ts:204
- options
- returns
Reload the relationship
then (success, fail) public
Defined in ../model/addon/-private/promise-many-array.ts:137
- success
- fail
- returns
- Promise
chain this promise