The store type; must expose a subscribe(listener) method.
The snapshot value type.
Pass the store instance (or null/undefined) and a selector that reads the snapshot off it
(s => s.getState()). subscribe is memoized on the store identity so it stays a stable reference
across renders; the snapshot selector may be an inline arrow. The null snapshot doubles as the
SSR snapshot, keeping it SSR-safe.
Like useBoundSyncExternalStore, but for a store that may be absent (
null/undefined) — the bound-method analog of useOptionalSyncExternalStore. It callsstore.subscribe(...)and the snapshot selector on the instance, so a normalthis-centric class whose methods are NOT pre-bound works without the caller detaching them (which would stripthis); returns the snapshot, ornullwhen there is no store.