@cartridge-engine/event
    Preparing search index...

    Function EventProvider

    • Provide an EventBus instance to the React component tree via context.

      Clears all listeners on unmount to prevent leaks in HMR / test scenarios. The caller owns the bus lifecycle — create it outside the component tree or with useRef, then pass it as the bus prop.

      Parameters

      • props: EventProviderProps

        Component props: bus (the EventBus instance to provide) and children (React children).

      Returns Element

      const bus = createEventBus<MyEvents>();
      render(
      <EventProvider bus={bus}>
      <App />
      </EventProvider>
      );