-
Notifications
You must be signed in to change notification settings - Fork 113
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
Memoization #59
Comments
Hi @JamesConsidine, Thank you for the issue! Some refs describing why it's better: With Example: #53 To use memorization you could combine useCallback + useDebouncedCallback:
In case you'd like to improve docs, I'll be glad to receive a PR :) |
Wow ok, I was clearly quite wrong here lol. Thanks for the example! I don't think I understand why we don't want to use deps though. Any chance you could give me a TLDR? Re: the docs, I do think they need something to explain how to use it like that, so ill have a crack at a PR when I get a moment |
The main reason is that automatic rules, like |
Ok cool! I was seeing this as a replacement for useCallback, but really it supplements it. So yeah, I will close the issue and have a crack at the docs later. Thanks for all the help! |
There is a heading in the documentation about memoization, but no example. I think you will need to allow a dependency array to be passed in, and make the usage the same as
useCallback
The text was updated successfully, but these errors were encountered: