This Ember addon provides you with utils and computed property macros to aid with common problems when working with promises in components.
- Subsequent promises take priorty over 'old' promises
(You're usually only ever bothered about the result from the most recent promise) - Setting the result of the promise on the component when the component may since have been destroyed will error.
Please use http://ember-concurrency.com instead
// items-list/component.js
import { promiseObject } from 'ember-promise-cps/macros';
export default Component.extend({
items: promiseArray('items-promise')
});
- Utils
promiseObject({ foo: 'bar' })
promiseArray([ 'foo', 'bar' ])
- Macros
promiseObject('myObject')
promiseArray('myArray')
ember install ember-promise-cps