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 Ability to Add Multiple Engines #161

Open
simon-lammes opened this issue Mar 1, 2021 · 0 comments
Open

Add Ability to Add Multiple Engines #161

simon-lammes opened this issue Mar 1, 2021 · 0 comments

Comments

@simon-lammes
Copy link

As a user of the library, I would like to be able to provide different storage engines for specific stores, so that I can store secret states like access tokens in secret storage (in Ionic for example) while storing other state in usual storage.

Currently, it is only possible to specify one storage engine within the initialization of the module:

NgxsAsyncStoragePluginModule.forRoot(IonicStorageEngine, {
  key: [SettingsState, AuthenticationState]
})

However, say I want the AuthenticationState stored in a secured storage. I need another Storage engine for that. I would suggest to make the following configuration (or something similar) possible:

NgxsAsyncStoragePluginModule.forRoot({
  storageStrategies: [
    {
      engine: IonicStorageEngine,
      key: [SettingsState]
    },
    {
      engine: IonicSecureStorageEngine,
      key: [AuthenticationState]
    },
  ]
})
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

No branches or pull requests

1 participant