Omnistac / zedux

:zap: A Molecular State Engine for React
https://Omnistac.github.io/zedux/
MIT License
381 stars 7 forks source link

fix(atoms): let the WeakMap clean up selector ref keys #66

Closed bowheart closed 1 year ago

bowheart commented 1 year ago

Description

Selectors with params can have multiple selector cache entries reusing the same _refBaseKeys entry. When one of these selectors is destroyed, it shouldn't delete the _refBaseKeys WeakMap entry - other selector caches could still be using it. Let the WeakMap clean up after itself instead.