-
Notifications
You must be signed in to change notification settings - Fork 39
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
Usage with localForage/IndexedDB/Dexie #53
Comments
Hi, you could pass the storage to import { recoilPersist } from 'recoil-persist'
const { persistAtom } = recoilPersist({
storage: localStorage, // configurate which stroage will be used to store the data
}) I can see that const customStorage = () => {
return {
setItem: (key, value) => {
// handle setItem
},
getItem: (key) => {
// handle getItem
// this function should return something
},
clear: () => {
// clear the whole db
},
}
}
const { persistAtom } = recoilPersist({ storage: customStorage() }) Another example how you could encode values before putting it in |
It moved! Thank you.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for creating this library. Saved me a ton of time and is super simple. I am however getting errors as I am using up all the provided space in local storage. Read up that using localforage or Dexie can get around this. Are we able to integrate these into recoil-persist?
The text was updated successfully, but these errors were encountered: