Jotai provides primitive functions to optimize re-renders.
It’s designed to hold only “current” atom values,
and it doesn’t cache older values.Caching is sometimes useful. For example, if an async atom
triggers network requests, we may want to cache the responses.jotai-cache is
a third-party library to help such use cases.
size (optional): maximum size of cache items.shouldRemove (optional): a function to check if cache items should be removed.areEqual (optional): a function to compare atom values.