Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add namespace for localStorage keys #279

Merged
merged 4 commits into from
Jan 4, 2019
Merged

Conversation

fsmanuel
Copy link
Member

@fsmanuel fsmanuel commented Feb 7, 2018

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:

  • Add a readme section

closes #168
ref #222

@fsmanuel fsmanuel force-pushed the feature/key-namespace branch 4 times, most recently from 4153b9e to 45fad18 Compare February 7, 2018 21:04
@vst
Copy link

vst commented Feb 12, 2018

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

@fsmanuel fsmanuel force-pushed the feature/key-namespace branch from 30e7d45 to af4214b Compare August 20, 2018 18:11
@fsmanuel fsmanuel force-pushed the feature/key-namespace branch from af4214b to 7ec1b0e Compare December 1, 2018 12:26
@fsmanuel fsmanuel force-pushed the feature/key-namespace branch 2 times, most recently from dffc0d1 to 9b8db47 Compare January 4, 2019 17:17
@fsmanuel fsmanuel force-pushed the feature/key-namespace branch from 9b8db47 to b4bea18 Compare January 4, 2019 17:17
@fsmanuel fsmanuel merged commit eece52d into master Jan 4, 2019
@fsmanuel fsmanuel deleted the feature/key-namespace branch January 4, 2019 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature-Request] Option for a project-prefix
2 participants