Omnistac / zedux

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

fix(react): make all stores of all atoms in the evaluation stack use the ecosystem's scheduler #10

Closed bowheart closed 1 year ago

bowheart commented 1 year ago

Description

The recent fix to make sure the default scheduler is restored whether or not the evaluationFinished mod is enabled (26d980b1eca3478bfdf7a1db1508261aa365c0b2) exposed a bug where the default scheduler would be restored as soon as any item in the evaluation stack is popped off.

Only restore the default scheduler when the last item in the stack is popped off.

Also add a regression test that 💯% reproduces this and confirms the fix.