title: Svelte Store: Am I missing the point of the stores subscribe method?
body: <p>I am learning Svelte and attempting to build a simple SPA. So far the biggest thing that doesn't make any sense to me is the subscribe method for stores. In all of the examples on <a href="https://svelte.dev/examples/writable-stores" rel="nofollow noreferrer">svelte.dev</a> its only used to link to an unsubscribe method for when a component is unMounted/Destroyed.</p>
  <p>On top of that, when I create my store I have done this.</p>
  <pre><code>import { writable } from 'svelte/store'
  
  const store = writable(0);
  
  function Notify()
  {
      store.subscribe(value =&gt; console.log(value));
  }
  
  function DoThing(newValues)
  {
     store.update(oldValues =&gt; oldValues = newValues);
     Notify();
  }
  </code></pre>
  <p>But in my logs, it still runs twice. Even though I am only calling it after my <code>store.update</code> call.</p>
  <p>Would greatly appreciate any explanations on what I could be misunderstanding or doing incorrectly.</p>