createReactiveStoreFromDataPublisher
Returns a ReactiveStreamStore given a data publisher.
The store will update its state with each message published to dataChannelName and notify all
subscribers. When a message is published to errorChannelName, subscribers are notified so they
can react to the error condition, but the last-known state is preserved. Triggering the abort
signal disconnects the store from the data publisher.
Things to note:
getUnifiedState()starts instatus: 'loading'until the first notification arrives.- On error,
getUnifiedState().datacontinues to return the last known value anderrorholds the failure. Only the first error is captured. - The function returned by
subscribeis idempotent — calling it multiple times is safe. - Because a
DataPublisherinstance cannot be restarted, `retry()` on the returned store throws a SOLANA_ERROR__SUBSCRIBABLE__RETRY_NOT_SUPPORTED | `SolanaError`.
Type Parameters
| Type Parameter |
|---|
TData |
Parameters
| Parameter | Type | Description |
|---|---|---|
config | Config | - |
Returns
ReactiveStreamStore<TData>
Deprecated
Use createReactiveStoreFromDataPublisherFactory instead. That variant accepts a factory function for the underlying DataPublisher and can therefore support `retry()`.