Selected slice type.
Pure selector over PipelineStore.
import { useShallow } from "zustand/shallow";
import { usePipelineValue } from "@playlive/react-pipeline";
const { connected, connecting } = usePipelineValue(
useShallow((s) => ({ connected: s.connected, connecting: s.connecting })),
);
Subscribe to a slice of the pipeline store. Only re-renders when the selected value changes (Zustand's default
Object.isequality).Throws if no import("../provider").RealtimePipelineProvider is mounted above the call site.
Custom equality semantics (shallow, deep, etc.) aren't accepted directly because Zustand v5 dropped the third arg on
useStoreto keep the package free of theuse-sync-external-storeshim peer. If you need shallow equality, wrap your selector withuseShallowfromzustand/shallow(a zero-extra-dep helper):