title: Parameterizing the name of the store in backbone-localStorage.js
body: <p>The standard way to use the <a href="http://documentcloud.github.com/backbone/docs/backbone-localstorage.html" rel="nofollow">localStorage</a> plugin for Backbone.js works like this:</p>
  
  <pre><code>  App.WordList = Backbone.Collection.extend({
  
      initialize : function(models, options){
      },
  
      localStorage : new Store('English')
  
    }
  </code></pre>
  
  <p>But I want to make different, parallel wordlist collections in different languages. So, I want to be able to instantiate the name of the Store upon initialization of the collection. AFAICT, this works ok:</p>
  
  <pre><code>  App.WordList = Backbone.Collection.extend({
  
      initialize : function(models, options){
        this.localStorage = new Store(options.language);
      }
  
    }
  </code></pre>
  
  <p>Then I can instantiate a WordList like:</p>
  
  <pre><code>  english = new Wordlist([], {language: 'English'});
  </code></pre>
  
  <p>Or:</p>
  
  <pre><code>  chinese = new Wordlist([], {language: 'Chinese'});
  </code></pre>
  
  <p>The thing is, I haven't really seen this done in any other examples and I'm wondering if anyone out there would have any "Eek! Don't do that, because..." sorts of reactions.</p>
  
  <p>EDIT</p>
  
  <p>I should add that I have already tried doing it this way:</p>
  
  <pre><code>App.WordList = Backbone.Collection.extend({
  
    initialize : function(models, options){
    },
  
    localStorage : new Store(options.store)
  
  }
  </code></pre>
  
  <p>And then:</p>
  
  <pre><code>  chinese = new Wordlist([], {language: 'Chinese'});
  </code></pre>
  
  <p>But for some reason <code>options.store</code> is coming up undefined.</p>