Omnistac / zedux

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

fix: prevent injectors from consuming hydrations #71

Closed bowheart closed 1 year ago

bowheart commented 1 year ago

Description

injectStore and similar store-injecting injectors shouldn't call ecosystem._consumeHydration() when their hydrate option is true since that breaks injector composability. Instead, always call ecosystem._consumeHydration() once, after evaluation is over. This allows all injectors that want it to receive the hydration.

@affects atoms, immer, machines