title: Singleton in Svelte
body: <p>I am trying to make a Svelte app, where I have a class (not svelte component) that create an audioSource, and manage it.</p>
  <p>I would like to get this class instance across multiple component.</p>
  <p>Right now, the only way I found is to do this :</p>
  <pre><code>&lt;script lang=&quot;ts&quot; context=&quot;module&quot;&gt;
    import { AudioAnalyser } from &quot;@app/class/audio/AudioAnalyser&quot;;
    import type { MediaAnalyser } from &quot;@app/types/analyser&quot;;
  
      let analyser: MediaAnalyser = new AudioAnalyser();
  &lt;/script&gt;
  </code></pre>
  <p>Inside a component, so I am sure there is only one instance, and share that instance via property binding with other Component.</p>
  <p>But I am trying to find a way where I could instantiate this class once and access it trought all the app like with an angular Service.</p>
  <p>thank you</p>