Created
August 27, 2015 20:46
-
-
Save rondale-sc/9a99bf6da63c4ebc5d6a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Ember from 'ember'; | |
| const slice = Array.prototype.slice; | |
| const PromisableObjectProxy = Ember.ObjectProxy.extend(Ember.PromiseProxyMixin); | |
| export default function(...args) { | |
| const fn = args.pop(); | |
| const dependentKeys = args.slice(); | |
| return Ember.computed(...dependentKeys, function() { | |
| const promise = fn.apply(this); | |
| return PromisableObjectProxy.create({ | |
| promise: Ember.RSVP.resolve(promise) | |
| }); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment