Omnistac / zedux

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

feat(react)!: reuse names that can be shared between instances & selectors #30

Closed bowheart closed 1 year ago

bowheart commented 1 year ago

Description

We can simplify quite a bit of logic by reusing some property names between atom instances and selectors. Change the evaluationFinished mod to simply use node instead of different instance and cache keys.

Change prevEvaluationReasons and _prevEvaluationResons to simply prevReasons.

Change nextEvaluationReasons and _nextEvaluationReasons to simply nextReasons.

This includes making those fields non-underscore-prefixed in the AtomInstance class and therefore adding documentation for them.

This is a breaking change - the evaluationFinished mod event's payload shape has changed and some already-public fields in the SelectorCache class are renamed: