A common pattern to temporarily use a buffered value instead of an actual value #696
vladcosorg
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This awesome lib has a lot of functions and perphaps it already exists, but if not: here's a very common pattern that I use in various projects.
This is useful when you are tracking a slow ref with a computed property, however if you trigger an update to it directly, it will make everything laggy, so you need to temporarily switch the computed getter to a buffer (so that the value change is reflected locally, then perform the slow operation and then swtich the computed getter back to tracking the initial value).
what do you think?
There are some functions in the lib, like deferred watcher and debounced refs that could replace this, but would require more code and lots of code dupe.
Beta Was this translation helpful? Give feedback.
All reactions