-
Notifications
You must be signed in to change notification settings - Fork 40
Closed
Description
Using this package does not work with React Native since their Storage API (aka the AsyncStorage API, here's a link to their docs) is asynchronous and this package does not seem to support an asynchronous Storage API. This issue is to simply open the conversation this subject.
The following is what I used to set the storage:
const {persistAtom} = recoilPersist({
storage: AsyncStorage,
});The error message:
There's an error here since toParse is a Promise.
Looking at the code, you could check if getItem() or/and setItem() is a promise to know if its async or not, then transform the functions to be async. This is potentially a naïve idea, but I'm not sure how it could be implemented otherwise, maybe you have a better idea on its implementation.
polemius and 1nspir3d
Metadata
Metadata
Assignees
Labels
No labels