Open GregOnNet opened 1 week ago
Great idea! What is buffer
doing? We could work on memoize
while also working on a debounce
function.
Oh, yeah buffer
… I thought it would be handy to be able to tell how many items are cached...
Example:
gregor@domain.de
which triggers an API call from the async validatorgregor@domain.uk
which is calling the API againgregor@domain.de
which is not calling the API because the outcome of the validation is still cached and not outdated.I hope clarifies the use-case a bit better.
I also like the idea of having debounce
for certain values. 💪🏻
After writing the example above, I started thinking if we are talking about cache & cacheAsync
instead of Memoization…
I posted this issue on X to get more feedback and ideas from other users. I am currently focusing on Valibot v1 and Standard Schema and think I will work on this issue after our stable v1 is out.
Preface - valibot is awesome
Thank you all for developing this library. It is the most type-safe library, I have ever used. It comes with great DX & the docs become better and better.
Use Case
Forms:
New action
memoize
Wouldn't it be nice if we could
memoize
the executions inside a schema, where it is needed? We could provide a synchronous and an asynchronous version...Example