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

useIndexedDb / useIDB #230

Closed
Fanna1119 opened this issue Nov 21, 2020 · 4 comments · Fixed by #2335
Closed

useIndexedDb / useIDB #230

Fanna1119 opened this issue Nov 21, 2020 · 4 comments · Fixed by #2335
Labels
enhancement New feature or request help wanted Extra attention is needed pr welcome

Comments

@Fanna1119
Copy link

Any plans for adding a IndexedDb utility ?

@Fanna1119 Fanna1119 changed the title useIndexedDb useIndexedDb / useIDB Nov 21, 2020
@antfu
Copy link
Member

antfu commented Nov 21, 2020

This is definitely good to have. However, I am not that familiar with IndexedDB, PR welcome. Another option is that we could have a wrapper for https://dexie.org/

@antfu antfu added the help wanted Extra attention is needed label Dec 22, 2020
@antfu antfu added enhancement New feature or request pr welcome labels Feb 22, 2021
@brokolosov
Copy link

brokolosov commented Apr 9, 2021

I found a local DB comparison (localStorage, localForage, indexDB, Dexie, LokiJS etc.) Based on this comparison, a better choice would be LokiJS. Dexie is to slowly... IMHO
P.S. video

@Fanna1119
Copy link
Author

LokiJS looks really decent, i have never heard of it before, thanks for the share!

@jssullivan
Copy link
Contributor

jssullivan commented Oct 11, 2022

I am working to make a composition wrapper around idb-keyval. Which is a key value store api on top of Indexed DB. It will have a similar type signature to useStorageAsync

This won't add full support for Indexed DB. However it will give you typed keys and values without the need of a serializer, adds web worker support, and lets you use more storage space when compared to using the local storage variant.

The caveat being it won't reactively update if another source updates the KV store. There isn't an event that fires when the Indexed DB is changed, unlike the Storage Api's (https://github.com/vueuse/vueuse/blob/main/packages/core/useStorage/index.ts#L164).

Can I open a PR adding it to vue-use? I was thinking the name would be useKVIndexedDB.

antfu pushed a commit that referenced this issue Nov 8, 2022
Co-authored-by: Jess Sachs <jess.sachs@pathai.com>
closes #230
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed pr welcome
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants