Last active
October 25, 2016 15:39
-
-
Save Gaurav0/2a7c5697de9e4438b759adffcb0404cc to your computer and use it in GitHub Desktop.
Ember Concurrency Test
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 } from 'ember-concurrency'; | |
export default Ember.Controller.extend({ | |
count: 0, | |
incrementBy: task(function * (inc) { | |
let speed = 400; | |
while (true) { | |
this.incrementProperty('count', inc); | |
yield timeout(speed); | |
speed = Math.max(50, speed * 0.8); | |
} | |
}) | |
}); |
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.7.2", | |
"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", | |
"babel-polyfill": "https://cdn.rawgit.com/nicksrandall/babel-polyfill/master/browser-polyfill.js" | |
}, | |
"addons": { | |
"ember-concurrency": "0.6.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment