memoized debounce
I want to memoize my debounced function but unfortunately it's not working. Can someone tell whats wrong.
2 Replies
you could try with this:
https://github.com/solidjs-community/solid-primitives/tree/main/packages/scheduled#createscheduled
there are two problems
1. sources need to be tracked synchronously before the debounced callback
2. dedounced function produces it's value after the memo fifnished executing, so you need a way to tell it to rerun again to grab the new value
GitHub
solid-primitives/packages/scheduled at main · solidjs-community/sol...
A library of high-quality primitives that extend SolidJS reactivity. - solid-primitives/packages/scheduled at main · solidjs-community/solid-primitives
@thetarnav thanks for the input. Is it possible to achieve it without any package ?