-
Notifications
You must be signed in to change notification settings - Fork 7
Description
In our nextjs app we get some data on a server and then hydrate it on client via EffectorNext component. Say we have $server store which serializes and sends data to the client. I noticed that if i have some derived store (say, $derived) based on this value via .map() or combine() utilitiy on each navigation i get multiple recalculations of this derived store despite the fact that the docs state that it should only recalculate when upstream store changes. Recalculations are called with the latest value of $server store.
Here are the steps to reproduce:
- provide some value via
$serverstore. Derived store calculates correctly - navigate to some other page with no
$servervalue provided. For some reason derived store recalculates.
If I use sample() everything is ok because this derived value gets serialized as well. useStoreMap works well too but with this approach i can't access this derived value in stores.
I reproduced this in playground-app in which there are not so many recalculations but in my production app i get 500+ calls on each not shallow page transition.
Am i doing something wrong and this is expected behavior? I expect combine to not be called at all.