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

Dynamically use storage without initializing #364

Open
anandlall112 opened this issue Oct 4, 2022 · 2 comments
Open

Dynamically use storage without initializing #364

anandlall112 opened this issue Oct 4, 2022 · 2 comments

Comments

@anandlall112
Copy link

anandlall112 commented Oct 4, 2022

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
Copy link
Member

fsmanuel commented Oct 10, 2022

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
Copy link
Member

fsmanuel commented Dec 6, 2022

@anandlall112 did my comment help?

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

2 participants