I'm trying to figure out how to work with Svelte stores properly.
In my code I have a store that it's initial value is either come from localStore if set or from const, I never called set or update on that store without some action from the user. In other component there is a subscriber for that store that doing server request in each change (I want the request to happen only if the store changes), however I notice that on app init the request is fire (the subscription callback is called)
Looking at the docs here https://svelte.dev/tutorial/writable-stores
count.subscribe(value => {
countValue = value;
});
I can see that the subscribe callback is running once even before I clicked any button.
How can I subscribe only to store changes (considering setting default value I pass to writeable is not "change")?