Skip to content

Instantly share code, notes, and snippets.

@housleyjk
Created May 13, 2016 00:14
Show Gist options
  • Save housleyjk/6470734cd3111fd3049f3e900aa676c4 to your computer and use it in GitHub Desktop.
Save housleyjk/6470734cd3111fd3049f3e900aa676c4 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName: "Debounce",
it: false,
actions: {
changeIt() {
this.toggleProperty('it');
}
},
logIt() {
console.log('logging it');
console.log(this.get('it'));
},
observeIt: Ember.observer('it', function() {
console.log('will debounce');
Ember.run.debounce(this, 'logIt', 5000);
}),
});
<h1>Welcome to {{appName}}</h1>
<button {{action 'changeIt'}}>Press Me</button>
{
"version": "0.8.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.5.1",
"ember-data": "2.5.2",
"ember-template-compiler": "2.5.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment