createReactiveStoreFromDataPublisherFactory
Returns a ReactiveStreamStore that wires itself to a fresh DataPublisher on every `connect()`.
The store accepts a createDataPublisher factory rather than a ready-made publisher — that
lets the store tear down a broken stream and open a new one without losing subscribers or the
last known value. The factory receives the per-connection signal so the underlying transport
can stop on per-connection abort, not just the stream-store's listeners.
Things to note:
- The returned store starts in
status: 'idle'. Callconnect()to open the first stream. createDataPublisheris invoked on everyconnect(). The store transitions throughloading, preserving the last knowndataanderror(stale-while-revalidate).- If
createDataPublisherrejects, the store transitions tostatus: 'error'with the rejection as the error. Callconnect()to try again. reset()aborts the current connection and returns the store toidle, clearingdataanderror. A follow-upconnect()opens a fresh stream.- Attach a caller-provided cancellation source via
`withSignal()` —
store.withSignal(signal).connect()composes the signal with the per-connection controller. Aborting the caller's signal transitions the store toerrorwith that abort reason.
Type Parameters
| Type Parameter |
|---|
TData |
Parameters
| Parameter | Type | Description |
|---|---|---|
config | FactoryConfig | - |
Returns
ReactiveStreamStore<TData>