API reference › @evolu/common › local‑first/Db › CreateDbWorker

type CreateDbWorker = () => DbWorker;

Defined in: packages/common/src/local-first/Db.ts:223

Creates the DbWorker that a tab hosts, which then receives its DbWorkerInit.

A platform whose worker can fail before it receives the init, such as a web worker whose script fails to load, posts the init only once the worker has loaded, and otherwise posts LeaderRefused with an UnknownError on the init's port in the worker's place.