Created
October 14, 2015 20:33
-
-
Save rondale-sc/322dcecac6624f6a9a65 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 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