Closed
Description
Reproduction
https://stackblitz.com/edit/github-u4jlt8
Steps to reproduce the bug
- Click "Negate
store.flag
" buttonn any times you like. You will see howstore.flag
negates, ang how its computedstore.negated
stays reactive. - Uncheck "Show
StoreUser
" input. The component will be unmounted. - Check it again, to mount the component back.
- Click "Negate" button again -
store.negated
is not reactive anymore.
Screen.Recording.2022-12-11.at.14.02.35.mov
Expected behavior
I expected the watchEffect()
, called within a Setup Store, to be active as long as the store's scope is active. It makes possible for utilities like computedEager()
just work in setup stores.
Actual behavior
The watch effect seems to bind not to the store's setup scope, but to the component where the initial useStore
invocation happened. Thus, when the component is unmounted, the watch effect is cleared and stopped, leaving the store in a broken and hard-to-debug state.
Additional information
No response
Metadata
Metadata
Assignees
Labels
No labels