title: How to clear all stores in ReactJs on logout/signout?
body: <p>I have multiple stores in my app, all of them do have constructors. During the flow of app our stores and localstorage gets updated with different values. On logout I'm able to clear localstorage data successfully. </p>
  
  <p>Code to clear all items from localstorage at one go </p>
  
  <pre><code>_clearStorage: function(){
      let len = localStorage.length;
      for (let i = len - 1; i &gt;= 0; i--) {
          let key = localStorage.key(i);
          if (key != null &amp;&amp; key != undefined &amp;&amp; key.indexOf('org.') == 0) {
              localStorage.removeItem(key);
          }
      }
  }
  </code></pre>
  
  <p>Is it possible for us to flush all data from stores in a react + flux app?   Interested in bringing back all stores to initial state when user logouts from the system. </p>
  
  <p>E.g of one of the Stores</p>
  
  <pre><code>import {EventEmitter} from "events";
  import dispatcher from "../dispatchers/dispatcher";
  
  class ItemStore extends EventEmitter{
      constructor(){
          super()
          this.itemTypes = [];                
      }
  
      _getter(){
          return this.itemTypes;
      }
      _setter(){
          // Some Logic
      }
  }
  const Stores = new ItemStore;
  dispatcher.register(Stores._handleActions.bind(Stores));
  window.dispatcher = dispatcher;
  export default Stores;  
  </code></pre>