Create a new DatabaseContext.
An open Database or a promise that will resolve to an one. Normally, you would want to pass the return value of Database.open in here directly.
The consumer component for this context.
Use it to wrap components that need the database in the usual React consumer way.
An open Database or a promise that will resolve to an one.
Generated using TypeDoc
A wrapper for a React context for passing a database connection to ComponentWrappers.
Normally, you use this by creating an instance somewhere and sharing it between components via DatabaseProvider and useDatabase.
type DBSchema = NamedSchema< "myDatabase" | "myOtherDatabase", 5, { favouriteColour: { key: string; value: { r: number; g: number; b: number; }; }; } >; const databasePromise = Database.open("myDatabase", 5); export const DBContext = new DatabaseContext(databasePromise);