Created
March 7, 2017 21:27
-
-
Save alexander-alvarez/8cc6e00930c41e7b1bb7f3be92c4699a to your computer and use it in GitHub Desktop.
cancel typeahead
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'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
typeAheadTask: task(function * (value) { | |
yield timeout(500); | |
return value | |
}), // you can cancel or whatever you like | |
actions: { | |
startTask(value){ | |
this.get('typeAheadTask').perform(value); | |
this.set('value', value); | |
} | |
} | |
}); |
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.11.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.11.0", | |
"ember-data": "2.11.0", | |
"ember-template-compiler": "2.11.0", | |
"ember-testing": "2.11.0" | |
}, | |
"addons": { | |
"ember-one-way-controls": "*", | |
"ember-truth-helpers": "*", | |
"ember-concurrency": "*" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment