funkensturm / ember-local-storage

The addon provides a storageFor computed property that returns a proxy and persists the changes to localStorage or sessionStorage. It ships with an ember-data adapter.
https://www.funkensturm.com/ember-local-storage/
MIT License
218 stars 76 forks source link

Add namespace for localStorage keys #279

Closed fsmanuel closed 5 years ago

fsmanuel commented 6 years ago

Implements a configurable namespace for localStorage keys used by the addon. For backward compatibility this is a opt-in feature. To activate it there are the following options:

// config/environment.js
module.exports = function() {
  var ENV = {
    modulePrefix: 'my-app',
    'ember-local-storage': {
      namespace: true, // will use the modulePrefix e.g. 'my-app'
      namespace: 'customNamespace', // will use 'customNamespace'
      keyDelimiter: '/' // will use / as a delimiter - default is : 
    }
  }
};

If a namespace is provided (true or custom) the format of a key is ${namespace}${delimiter}${key}.

TODO:

closes #168 ref #222

vst commented 6 years ago

Thanks! Looks fine to me... Will try to check on working codebase.