svelte-persisted-store icon indicating copy to clipboard operation
svelte-persisted-store copied to clipboard

feat: IndexedDB support

Open intercepted16 opened this issue 1 year ago • 6 comments

Implement IndexedDB support, useful for storing larger amounts of data.

  • The persisted function is now deprecated, but remains functional
  • Instead of a storage option, there are now three seperate functions; localState, sessionState and indexedDBState
  • The localState and sessionState functions remain the same, aside from the storage parameter
  • indexedDBState is asynchronous and uses async/await (or callback)
  • Some refactoring was done, specifically with types

PS: persisted remains functional with the same API

intercepted16 avatar Jun 09 '24 09:06 intercepted16

@intercepted16 thanks for the udpated PR, but please, don't continue unless @joshnuss says so. I just expressed my opinion in the form of a PR review. That's it. It is unclear to me if @joshnuss is even agreeable to adding this feature.

webJose avatar Jun 10 '24 01:06 webJose

@webJose Your changes were small, so I figured implementing them wouldn't hurt.

intercepted16 avatar Jun 10 '24 01:06 intercepted16

@joshnuss Are you willing to add this feature? It's been a while with no response.

intercepted16 avatar Jul 13 '24 08:07 intercepted16

Hi, I do t have a good answer right now.

The next priority for the project is adding support for runes, so I'm not sure we should add more features right now.

Is this an important requirement you're waiting on?

joshnuss avatar Jul 16 '24 01:07 joshnuss

@joshnuss Yes, I'd prefer to use the library for this; currently I'm using a custom solution. Maybe, as breaking changes are being implemented anyway, you could include this pull request in the runes change?

intercepted16 avatar Jul 16 '24 05:07 intercepted16

I second (third) this PR/feature!

plutonium-239 avatar Oct 06 '24 23:10 plutonium-239

@joshnuss Still nothing?

intercepted16 avatar Feb 27 '25 07:02 intercepted16

Sorry, can you clarify what the question is?

joshnuss avatar Feb 27 '25 08:02 joshnuss

@joshnuss are you going to add it? Been 9 months since made, and you've updated it to svelte 5.

intercepted16 avatar Feb 27 '25 08:02 intercepted16

The repo still needs to be updated to Svelte Runes.

Once that happens we can consider whether to add new storage adapters.

But I cannot promise anything, the API for indexed db and local/session storage are quite different and it might not make sense to fit them in the same API, research will have to be done, so no promises.

joshnuss avatar Feb 27 '25 08:02 joshnuss

@joshnuss Has it been updated to Svelte Runes. this PR is almost a year old now!

intercepted16 avatar Jun 07 '25 09:06 intercepted16

It hasn't been updated yet.

This project is updated on my free time, and is not sponsored work. So please refrain from placing pressure on me.

joshnuss avatar Jun 07 '25 17:06 joshnuss

@joshnuss My bad, not trying to put pressure.

intercepted16 avatar Jun 08 '25 02:06 intercepted16