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

feat: ability to specify preferred storage type #22

Closed
dylanvdmerwe opened this issue Oct 14, 2016 · 3 comments
Closed

feat: ability to specify preferred storage type #22

dylanvdmerwe opened this issue Oct 14, 2016 · 3 comments

Comments

@dylanvdmerwe
Copy link

It would be create to have an enum passed into the Storage constructor that allows the user to specify their preferred storage type.

If their preferred storage type is not available, show a warning in the console, and then proceed to pick the next best storage option as you normally would.

The reason why I want this is because when I am working in the browser, I would very much like to use localstorage over everything else. Especially when running ionic serve and debugging on chrome and changing the device types quite a lot, the IndexedDb instance resets which is a pain. Localstorage persists quite nicely in this case.

@matiasmoya
Copy link

matiasmoya commented Oct 14, 2016

The PR #6 will introduce this feature.

@tcrespog
Copy link

The PR #6 has already been merged, I see the setDriver function (https://github.com/driftyco/ionic-storage/blob/master/src/storage.ts#L152):
setDriver(engine: string) { this._db.setDriver(this._db.engine); }
However I'm not sure how to use it. In the first place it confuses me that the engine param is not used in the function body.
Any clarification on this?

@jgw96
Copy link
Contributor

jgw96 commented Oct 31, 2016

Hello @tcrespog ! I just pushed a commit to fix the issue you mentioned, sorry for the confusion.

@mlynch mlynch closed this as completed Jan 17, 2017
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

5 participants