Skip to content

Add debounce class method#2

Open
omriAckley wants to merge 2 commits intomasterfrom
pending-utility
Open

Add debounce class method#2
omriAckley wants to merge 2 commits intomasterfrom
pending-utility

Conversation

@omriAckley
Copy link
Copy Markdown
Collaborator

This is for transforming a function (source) into one (debounced) that will not re-execute the source if the source returns a promise and a previous execution's promise has yet to resolve.


//----- promise methods -----

$Promise.debounce = function (sourceFn) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$Promise is the internal promise class and is not exposed to the user — this can be placed on Potential, which is the library / public API namespace.

@glebec
Copy link
Copy Markdown
Owner

glebec commented Jun 24, 2016

Will merge this when it has tests (by you or me, either way) and when the namespace is fixed as mentioned above. :-)

If you work on this, make sure to pull & merge master as the core library has changed since this PR was opened.

@joeldarling
Copy link
Copy Markdown

Would love this feature.

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.

3 participants