API reference / @evolu/common / Worker

Worker

Cross-platform worker abstraction

Interfaces

InterfaceDescription
WorkerCross-platform worker abstraction.
WorkerPostMessageDep-

Type Aliases

Type AliasDescription
MessageHandlersType helper to extract message types from a union type
WithErrorReportingError reporting wrapper that catches synchronous errors in handlers and converts them to transferable error messages sent to the main thread.

Functions

FunctionDescription
createInitializedWorkerCreates a Worker that supports initialization with dependencies and safe error handling.
createInitializedWorkerWithHandlersCreates a Worker with type-safe message handlers for each message type. This provides better type safety and organization compared to a single onMessage handler.

Was this page helpful?