Skip to content

Add an "immediate" argument - #6

Open
nbish11 wants to merge 1 commit into
m-gagne:masterfrom
nbish11:immediate-feature
Open

Add an "immediate" argument#6
nbish11 wants to merge 1 commit into
m-gagne:masterfrom
nbish11:immediate-feature

Conversation

@nbish11

@nbish11 nbish11 commented Jan 21, 2015

Copy link
Copy Markdown
Contributor

This parameter can be useful in a lot of situations, for example:

// Using MooTools here
// A simple user-activity script

document.body.addEvent('mousemove', function () {
    this.set('data-useractivity', true);
}.debounce(250, true));

document.body.addEvent('mousemove', function () {
    this.set('data-useractivity', false);
}.debounce(250, false));

@m-gagne

m-gagne commented Mar 1, 2015

Copy link
Copy Markdown
Owner

This PR would change the order of parameters for debounce, also if we pull this in, it should also apply to the limit function as well (I'm hoping to keep functional parity between the two).

@nbish11

nbish11 commented Mar 2, 2015

Copy link
Copy Markdown
Contributor Author

Hmmm, I see what you mean. While I could implement the immediate functionality to throttle(), it wouldn't really make sense if the immediate was required after context. Maybe it can be pulled into a future version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants