@em.b wrote:
I'm trying to throttle calls to a function that needs to run whenever a mousemove action occurs. Problem is that the function gets called with no throttling at all, i.e. as fast as possible; I've tried 1500ms with no evidence of throttling showing. The Ember docs give an example of how it's supposed to work, but the example is different than the context I'm working within, which is that the function gets called by an action helper on a template.
What am I doing wrong?
template code:
<div id="grid" {{action 'handleMove' on="mouseMove"}}></div>
component code:
actions: { handleMove: function() { Ember.run.throttle({name: 'test'}, this.processMove, 300); } } processMove() { console.log(this.name + ' ran.'); }
Posts: 2
Participants: 2