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
Property | Modifier | Type | Description | Defined in |
---|---|---|---|---|
execute | readonly | (id , arg? ) => void | Executes and removes a callback associated with the given ID. | packages/common/src/Callbacks.ts:18 |
register | readonly | (callback ) => CallbackId | Registers a callback function and returns a unique ID. | packages/common/src/Callbacks.ts:15 |