Rebind every live entry to a new ThreadStream (or detach
when thread == null).
Each live entry has its current runtime disposed (best-effort)
and its store reset to entry.initial so consumers see a clean
slate during the swap. When thread != null, a fresh runtime is
opened against the new thread.
Critically the StreamStore instance is preserved across
the rebind: framework subscribers (e.g. React's
useSyncExternalStore) keep observing the same store reference,
so their subscriptions survive the swap.
No-op when called with the currently bound thread.
bind(thread: ThreadStream<Record<string, unknown>> | undefined)| Name | Type | Description |
|---|---|---|
thread* | ThreadStream<Record<string, unknown>> | undefined | The thread stream to bind, or |