API
useRiver
Hook to get an observable from the sync agent.
An alternative of our premade hooks, allowing the creation of custom abstractions.
Imports
Definition
Source: useRiver
Parameters
selector
- Type:
(sync: SyncSelector) => Observable<T>
A selector function to get a observable from the sync agent.
config
- Type:
ObservableConfig.FromData<T>
- Optional
Configuration options for the observable.
config.fireImmediately
- Type:
boolean
- Optional
Trigger the update immediately, without waiting for the first update.
config.onError
- Type:
(error: Error) => void
- Optional
Callback function to be called when an error occurs.
config.onUpdate
- Type:
(data: Data) => void
- Optional
Callback function to be called when the data is updated.
Return Type
The data from the selected observable.
Was this page helpful?