Last active
September 21, 2018 06:24
-
-
Save bendemboski/b5668daae211c11e4d254265be9b3847 to your computer and use it in GitHub Desktop.
New Twiddle
This file contains 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'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
doSomething: task(function*() { | |
return yield 'task result'; | |
}), | |
runTask: task(function*(es5Getter) { | |
this.set('result', ''); | |
try { | |
if (es5Getter) { | |
this.set('result', yield this.doSomething.perform()); | |
} else { | |
this.set('result', yield this.get('doSomething').perform()); | |
} | |
} catch (e) { | |
this.set('result', `ERROR: ${e}`); | |
} | |
}) | |
}); |
This file contains 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
{ | |
"version": "0.15.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "canary", | |
"ember-template-compiler": "canary", | |
"ember-testing": "canary" | |
}, | |
"addons": { | |
"ember-concurrency": "0.8.19" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment