constructor
The constructor begins opening a Client immediately, and returns before the Client is ready.
new Client(options?: ClientOptions): Client| Type | Description | |
|---|---|---|
options? | ClientOptions | |
| returns | Client |
Prefer the create function, which constructs a Client and resolves once it is ready, unless code specifically needs the waitReady lifecycle.
Example
import {Client} from 'tinyjoin';
const db = new Client({dataDir: 'opfs://my-app-v1'});
console.log(db.ready);
// -> false
await db.waitReady;
console.log(db.ready);
// -> true
await db.close();