Created
November 18, 2016 15:47
-
-
Save machty/ddb5b337c118f6e026ea3cebe5a38b3a to your computer and use it in GitHub Desktop.
New Twiddle
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'; | |
import { task, timeout, asyncComputed, emit } from 'ember-concurrency'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
value: "type stuff here", | |
delayed: asyncComputed('value', function * (value) { | |
yield timeout(800); | |
return value; | |
}), | |
upper: asyncComputed('delayed', function * (asyncValue) { | |
let value = yield asyncValue; | |
yield timeout(800); | |
return value.toUpperCase(); | |
}), | |
reverse: asyncComputed('upper', function * reverse(asyncValue) { | |
return (yield asyncValue).split('').reverse().join(''); | |
}), | |
joined: asyncComputed('delayed', 'upper', function * (delayed, upper) { | |
yield emit("Please Wait..."); | |
return [yield delayed, yield upper].join('--'); | |
}), | |
}); |
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
{ | |
"version": "0.10.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.6.0", | |
"ember-data": "2.6.1", | |
"ember-template-compiler": "2.6.0" | |
}, | |
"addons": { | |
"ember-concurrency": "tof3" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment