mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
* [react-cache] Remove `cache` as argument to `read` Updated is API is `Resource.read(key)` instead of `Resource.read(cache, key)`. The cache is read from context using `readContext`. This also removes cache invalidation entirely (other than the default LRU mechanism), as well as the ability to have multiple caches. We'll add it back once `Context.write` lands and we can implement it the right way. Since there's now only a single cache (the global one), we don't actually need to use context yet, but I've added a dummy context anyway so the user gets an error if they attempt to read outside the render phase. * nits * Add test for thenables that resolve multiple times
react-cache
A basic cache for React applications. It also serves as a reference for more advanced caching implementations.
This package is meant to be used alongside yet-to-be-released, experimental React features. It's unlikely to be useful in any other context.
Do not use in a real application. We're publishing this early for demonstration purposes.
Use it at your own risk.
No, Really, It Is Unstable
The API may will change wildly between versions.