-
-
Save alexander-alvarez/20bb29913da39e57a04b024d519d1375 to your computer and use it in GitHub Desktop.
ember-concurrency starter
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'; | |
import { task, timeout } from 'ember-concurrency'; | |
const {computed} = Ember; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
myTask: task(function * (string) { | |
console.log("Waiting... " + string); | |
yield timeout(1000); | |
console.log("Done"); | |
}), | |
inputA: ['a', 'b'], | |
inputB: true, | |
values: computed('inputA', 'inputB', function() { | |
const inputB = this.get('inputB'); | |
return this.get('inputA').map((o) => this.get('myTask').perform(`${o}:${inputB}`)); | |
}) | |
}); |
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.10.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": 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": "latest" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment