As described in https://github.com/ctrlplusb/easy-peasy/issues/913, when a model created by useLocalStore is re-created due to dependency array change, it won't unsubscribe itself and will continue delivering state updates to (now new) model.
The test case added in this PR demonstrates exactly that (fails on current master, works in this branch).
As described in https://github.com/ctrlplusb/easy-peasy/issues/913, when a model created by
useLocalStore
is re-created due to dependency array change, it won't unsubscribe itself and will continue delivering state updates to (now new) model.The test case added in this PR demonstrates exactly that (fails on current
master
, works in this branch).