Function

useTimelineEvent

Subscribes to a typed TimelineEngine event with a React-safe latest handler. The hook keeps the event subscription stable while updating the callback ref every render, avoiding stale closures without resubscribing for handler-only changes.

Signature

Type Definition
useTimelineEvent(eventName: EventName, handler: TimelineEventHandler<EventName>, options: TimelineEventOptions = {}): void

Type parameters

NameConstraintDefaultDescription
EventNametypeOperatorNoneNo type parameter summary yet.

Parameters

NameTypeDescription
eventNameEventNameTimelineEngine event name to subscribe to.
handlerTimelineEventHandler<EventName>Callback invoked with the typed event payload.
optionsTimelineEventOptionsOptional subscription controls.

Returns

void