update throttle and debounce description based on lodash docs#30
Open
webkonstantin wants to merge 2 commits intoopen-cli-tools:masterfrom
Open
update throttle and debounce description based on lodash docs#30webkonstantin wants to merge 2 commits intoopen-cli-tools:masterfrom
webkonstantin wants to merge 2 commits intoopen-cli-tools:masterfrom
Conversation
…ditional options for throttle and debounce provided by lodash
|
|
||
| var debounceOpts = createDebounceOpts(opts); | ||
| var debouncedRun = _.debounce(throttledRun, opts.debounce, debounceOpts); | ||
|
|
Collaborator
There was a problem hiding this comment.
what happens here when you pass the throttled function to debounce?
Author
There was a problem hiding this comment.
Passing throttled function to debounce was not introduced by me in this PR, but in this commit by ElliotChong and merged before
kimmobrunfeldt/chokidar-cli@609228b#diff-168726dbe96b3ce427e7fedce31bb0bcR142
I believe it combines debounce (execute after specified ms have elapsed since the last time the debounced function was called) and throttle (do not execute more than once in specified timeframe) behaviour as you would expect without any negative side-effects.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allows specifying behaviour described in this issue #25 using
--debounce-leadingoption