Skip to content

@pgege/kaboo-react


Function: useInterruptBridge()

useInterruptBridge(): object

Defined in: context/InterruptBridge.tsx:92

Reads the InterruptBridge: the list of open interrupts plus publish. Most consumers want useInterruptFor instead; use this to inspect or drive the whole set.

Returns

active

active: ActiveInterrupt[]

Every open interrupt from the current run, in emission order.

publish

publish: (interrupts) => void

Replace the set of interrupts published to the bridge.

Parameters

interrupts

ActiveInterrupt[]

Returns

void

Example

import { useInterruptBridge } from "@pgege/kaboo-react";

function OpenGateCount() {
  const { active } = useInterruptBridge();
  return <span>{active.length} open</span>;
}