-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Description
Very helpful package! Thank you.
I'm using ImmortalDB with React to save some page state to local.
I would like to init a component's state by loading locally stored state, like:
const MyComponent = () => {
const [state, setState] = useState(() => {
return ImmortalDB.get('key')
})
}But ImmortalDB.get returns a Promise, so the above line would be return await ImmortalDB.get('key').
And React's useState does not support async functions,
so a synchronous get would be very helpful
Metadata
Metadata
Assignees
Labels
No labels