Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to pass leading option and others to debounce #93

Open
ghost opened this issue Jan 20, 2018 · 2 comments
Open

Need to pass leading option and others to debounce #93

ghost opened this issue Jan 20, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Jan 20, 2018

I need to be notified when a change starts. So, I'd like to pass {leading: true} to the call to debounce on line 26 of Component.js.

The reason that I need this is that I use the existence of a value to toggle my floating labels.

I tried it out with my local project in node_modules/react-debounce-input and it works great:

    var debouncedChangeFunc = (0, _lodash2.default)(function (event) {
      _this.isDebouncing = false;
      _this.doNotify(event);
    }, debounceTimeout, {leading:true});

Also, I think that the maxWait option for lodash debounce will be useful for very fast typists.

@ghost
Copy link
Author

ghost commented Jan 20, 2018

To be clear, in my leading example above - I want to get a change event when they start typing and then when they finish - and that is exactly what happens when I pass {leading:true}, as long as I type really fast. If I pause while I'm typing, I also get a change event which is fine.

@ghost
Copy link
Author

ghost commented Jan 20, 2018

@nkbt I am comfortable making this change myself and I will have to soon enough anyway because all of my forms depend on it now.

However, if within the next few days you indicate that you would prefer to make this change yourself then I will abstain from forking and making a pull request.

Thanks for your work!

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

No branches or pull requests

0 participants