amos-project / amos

A decentralized, out-of-the-box state management library.
https://amos-project.github.io/amos/
MIT License
12 stars 2 forks source link

A big problem with reselect. #1

Open acrazing opened 3 years ago

acrazing commented 3 years ago

What the cache should be?

acrazing commented 3 years ago
  1. If a selector is not marked as cacheable, it well always be recomputed
  2. A cacheable selector should be created by selector(fn, cacheKey, type?)
  3. Cache is in store, rather than in useSelector
  4. the last result is always cached of a cacheable selector, with useSelector, every call of select should be called with select(current, previous) to drop the outdated caches.
acrazing commented 3 years ago

Think about the box:

How to work with mutable map?