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

Dynamically use storage without initializing #364

Open anandlall112 opened 2 years ago

anandlall112 commented 2 years ago

Hi fellas, i am building a dynamic app where i am integrating more than 200 apps that are plug and play. user can install them as needed. i really don't want to create a storage for each of them. so, Is there a way to use ember-local-storage dynamically without creating a storage class? as of current, to get pass this i am using localforage but would rather drop the dependency and use only ember-local-storage which i am already consuming as well.

Example @storageFor('dynamic-name-here')

fsmanuel commented 2 years ago

Maybe you can use the model property: storageFor(key, model)

model Optional string - The dependent property. Must be an ember data model or an object with modelName and id properties.

If every of the 200 apps has an identifier (modelName and id) you can reuse the same storage but it will save a version per app.

fsmanuel commented 1 year ago

@anandlall112 did my comment help?