Function: dispatchIfRegistered()
agentmux / agent-document-store / dispatchIfRegistered
dispatchIfRegistered(
blockId,command,source?,opts?):AgentDocumentEvent[]
Defined in: agent-document-store.ts:228
Soft-dispatch variant. Returns an empty event array if the slot is already gone, instead of throwing. Use ONLY from async contexts (RAF / setTimeout / setInterval / await continuations / subscription handlers) where a normal dispatch can race against the pane’s onCleanup unregistering the slot — see docs/analysis/LIFECYCLE_DISPATCH_LEAK_2026_05_15.md §6.1 option B.
Synchronous component-body dispatches MUST continue to use dispatch
— a missing slot there is a registration-order bug and the throw is
the right signal.
Parameters
Section titled “Parameters”blockId
Section titled “blockId”string
command
Section titled “command”source?
Section titled “source?”CommandSource = "system"
ReducerOptions