Subscribe to a narrow slice of the session snapshot.
Unlike useSession — which re-renders the component on every
snapshot change — this only triggers a re-render when the selected value
changes (per isEqual, default Object.is). Use it for components that
read a single field, e.g. useSessionSelector((s) => s.running).
The selector must be pure. It may run on every snapshot change, so keep it
cheap; when it returns a derived object, pass a custom isEqual to avoid
re-renders on referentially-new-but-equal results.
Subscribe to a narrow slice of the session snapshot.
Unlike useSession — which re-renders the component on every snapshot change — this only triggers a re-render when the selected value changes (per
isEqual, defaultObject.is). Use it for components that read a single field, e.g.useSessionSelector((s) => s.running).The selector must be pure. It may run on every snapshot change, so keep it cheap; when it returns a derived object, pass a custom
isEqualto avoid re-renders on referentially-new-but-equal results.