Skip to content

A react hook wrapping idb-keyval

Notifications You must be signed in to change notification settings

will-ks/use-idb-keyval

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

useIdbKeyval

idb-keyval is a lightweight promise-based keyval store implemented with IndexedDB.

useIdbKeyval is a react hook wrapping idb-keyval.

Installation

yarn add @will-ks/use-idb-keyval

Usage

// Set a value
const [setFoo, { loading, error, isSet }] = useIdbKeyvalMutation('myKey')
setFoo(true)

// Retrieve a value
const [foo, { loading, error }] = useIdbKeyvalQuery<boolean>('myKey', [isSet])

About

A react hook wrapping idb-keyval

Resources

Stars

Watchers

Forks

Packages

No packages published