idb-keyval is a lightweight promise-based keyval store implemented with IndexedDB.
useIdbKeyval is a react hook wrapping idb-keyval.
yarn add @will-ks/use-idb-keyval
// Set a value
const [setFoo, { loading, error, isSet }] = useIdbKeyvalMutation('myKey')
setFoo(true)
// Retrieve a value
const [foo, { loading, error }] = useIdbKeyvalQuery<boolean>('myKey', [isSet])