title: Listen / Observe - changes in LocalStorage using store.js
body: <p>I am using <a href="https://github.com/marcuswestin/store.js" rel="nofollow noreferrer">store.js</a> (A JS library) to manage local storage.</p>
  <p><strong>What I am trying to do</strong></p>
  <p>Save value of <code>client</code> in <code>localStorage</code> in one tab of the browser and then when the value changes, I want to listen to the value changed.</p>
  <p><strong>Problem</strong></p>
  <p>The below code works in the same tab of the browser, but when I check another tab, there is no change event triggered.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>store.set('client', {
    'name': Math.random()
  });
  
  $('#mybtn1').click(function() {
    store.set('client', {
      'name': Math.random()
    });
  });
  
  
  store.observe('client', function(val, oldVal) {
    console.log('changed');
    console.log(store.get('client'));
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://raw.githubusercontent.com/marcuswestin/store.js/master/dist/store.everything.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;button id="mybtn1" type="button"&gt;click&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  <p><strong>Help</strong></p>
  <p>Can you please guide on what I am going wrong. I am also open to using Jquery for these changes listening.</p>