I am trying to set up a debounce on the window's resize event and have previously been able to with underscore and jquery as follows:
$(window).on('resize', _.debounce($.proxy(this.windowWidthChanged, this), 333));
I took this thinking and tried to apply it to Ember's Ember.run.debounce
as follows:
$(window).on('resize', Ember.run.debounce(this, this.windowWidthChanged, 333));
The event listener does not seem to fire at all...
like you might have guessed, you weren't passing a function into the resize event, but the cancel information(the result of calling debounce).
This goes back to the classic setTimeout dilemma, why is it running immediately?