useIDBState import useIDBState from "use-idb-state"; const [state, setState, loading] = useIDBState("myState", { foo: "bar" });