Closed frederikhors closed 1 year ago
Hey there! Thank you. There is not currently any support for that and I don't think I would want to have a dependency explicitly built into the package. However what might work is to allow persisted stores to be optionally configured to add custom storage types.
i.e. something like this....
createStorageType('INDEXED_DB', { getStorageItem: // custom get function, setStorageItem: // custom set function, removeStorageItem: // custom remove function});
const somePersistedData = persisted(
'some initial value',
'SOME_KEY',
{ storageType: 'INDEXED_DB' }
);
Does that sound like it would work?
Yeah. Something like that.
I would like to have something like tanstack/query
with persistence in browser.
tanstack/query currently does not support Svelte persistence: https://github.com/TanStack/query/discussions/5463
new feature should be out and live on version 1.0.16 https://github.com/square/svelte-store/commit/2fcd8f912304e345f8937044f7bfba35903339d9
Amazing project, congratulations!
Is there a way to persist to IndexedDB?