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

Optional immediate, non-debounced onChange callback #55

Open
flux627 opened this issue Oct 5, 2016 · 6 comments
Open

Optional immediate, non-debounced onChange callback #55

flux627 opened this issue Oct 5, 2016 · 6 comments

Comments

@flux627
Copy link

flux627 commented Oct 5, 2016

It would be nice to trigger loading indicators as soon as they start typing, to have the user feel like it's doing something, without the lag of the debounce. It could be called "immediateOnChange".

Any suggestions on how to do this without any modifications to react-debounce-input would also be appreciated

@nkbt
Copy link
Owner

nkbt commented Oct 5, 2016

Interesting suggestion. I don't think you can do this now without code modifications. Are you keen to PR? I believe it would be nice addition.

@flux627
Copy link
Author

flux627 commented Oct 13, 2016

I was thinking of making this possibly more useful with an "onDebounceStart", so it only fires once when the debounce timeout starts, rather than every time the input changes. I can see value in both this and an "immediateOnChange" event, however I'm not in love with that name. Maybe "onEveryChange"?

@nkbt
Copy link
Owner

nkbt commented Oct 13, 2016

onEveryChange sounds ok to me, also keeps onX convention for callbacks

@oyeanuj
Copy link

oyeanuj commented Mar 1, 2018

@flux627 Did you ever making this happen in any branch or PR by any chance?

@flux627
Copy link
Author

flux627 commented Mar 2, 2018

Never did, no.

@CalMlynarczyk
Copy link

CalMlynarczyk commented Sep 6, 2019

We were able to accomplish this by wrapping an input component and directly invoking the onChange handler that came from DebounceInput, as well as an immediate onChange handler that we wanted. We wanted to split cheap (ex. writing to Redux) and expensive (ex. sending the input in an AJAX request) event handlers so we could debounce the expensive ones.

Codepen

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

No branches or pull requests

4 participants