-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Debounce does not work? #146
Comments
Looks like debounce fell through the cracks on the In the meantime, you can bring in debounce from underscore or lodash and debounce your method instead: |
Thanks, lodash does indeed do the job! |
It sure does. I'll probably end up pulling in |
Have you thought about dropping the feature, for the same reason Evan dropped it from Vue? That way we can pull it in or not on our side depending if we need it. |
I've had that thought, but now you've got me really thinking about it. In the case of this component I don't think the details around losing access to the inputs state apply, but the argument around needing throttle vs. debounce does make sense here. The other issue is file size - I really want to keep things as lean as possible. So leaving out debounce is a plus there. Also less work for me 👍 . The only advantage of baking it right into the component is that it likely fit's the 80/20 rule where it does make things easier for the majority of the user base (but maybe you could have said the same about the debounce filter). On the flipside - if a user is already pulling in lodash/underscore, then I'm adding duplicate bulk. I'm leaning towards dropping it. |
If my vote counts for anything, I'd say drop it. As you mention, it's less work for you, and it means we can choose lodash/underscore, debounce/throttle. In my case I was already using lodash/debounce, so it's better for me if it's not duplicated. I guess that's a likely scenario now that Vue doesn't include a debouncer. If there's overwhelming public outcry, you can always reconsider! |
Your vote counts for a lot. One thing I've learned about writing open source stuff is that feedback is critical to success - ignore the users and no one's going to use your stuff. Done deal, debounce is getting canned! Thanks for taking the time to chat about it. |
It would be really great to have an example of how to implement debounce ourselves in the docs using lodash/underscore. I tried making the |
@sagalbot do you have any working examples of implementing debounce with newer versions of this lib? |
My onSearch function runs on every keypress regardless of what I set the debounce prop to:
http://jsbin.com/zuhusiwadu/1/edit?html,js,console,output
The text was updated successfully, but these errors were encountered: