Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ryanlabouve/cdb4f1917183d3fe3df3c68357ffa79e to your computer and use it in GitHub Desktop.
Save ryanlabouve/cdb4f1917183d3fe3df3c68357ffa79e to your computer and use it in GitHub Desktop.
Ember Concurrency Test
import Ember from 'ember'
function sendPress() {
this.sendAction('press');
}
function sendRelease() {
this.sendAction('release');
}
export default Ember.Component.extend({
tagName: 'button',
touchStart: sendPress,
mouseDown: sendPress,
touchEnd: sendRelease,
mouseLeave: sendRelease,
mouseUp: sendRelease,
});
import Ember from 'ember';
import { task, timeout } from 'ember-concurrency';
export default Ember.Controller.extend({
yeyTask: task(function*() {
yield;
})
});
<a
href="http://google.com"
onclick={{perform yeyTask}}
>
Yey!
</a>
{
"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