API Reference / @evolu/common / Callbacks / Callbacks

Interface: Callbacks

Defined in: packages/common/src/Callbacks.ts:13

Manages one-time callback functions.

Allows registering callbacks with a unique ID and executing them once with an optional argument. Executed callbacks are automatically removed.

This is useful for managing event-driven or asynchronous workflows where callbacks need to be invoked only once.

Properties

PropertyModifierTypeDescriptionDefined in
executereadonly(id, arg?) => voidExecutes and removes a callback associated with the given ID.packages/common/src/Callbacks.ts:18
registerreadonly(callback) => CallbackIdRegisters a callback function and returns a unique ID.packages/common/src/Callbacks.ts:15

Was this page helpful?