@playlive/react-pipeline
    Preparing search index...

    Function useOnScheduleTransition

    • Subscribe to schedule-block transitions and invoke handler for every new or updated entry in store.lastScheduleTransitions.

      The handler is stashed in a ref so this hook subscribes to the store exactly once (idempotent across re-renders). The optional campaignIDs filter is compared each fire — empty / undefined means "all campaigns".

      Fires on the leading edge of a change: transitions already present on the store when the hook mounts are treated as the baseline and do NOT fire the handler. Every subsequent boundary crossing does. Reference identity of the per-campaign payload is guaranteed fresh by the server's at field.

      Unlike the selector hooks in this module, this hook soft-fails when no <RealtimePipelineProvider> is mounted — it silently does nothing. This lets consumers wire a transition listener into components that may render outside a pipeline provider (tests, storybook stubs, standalone demos) without a hard throw. Selector hooks continue to require a provider.

      Parameters

      • handler: (payload: ScheduleTransitionPayload) => void
      • Optionaloptions: { campaignIDs?: readonly string[] }

      Returns void

      useOnScheduleTransition((payload) => {
      console.log("block changed", payload.current?.scheduleName);
      refetchSchedule();
      }, { campaignIDs: [campaignID] });