useRealtime
useRealtime(
options):object
Hook to subscribe to realtime changes for a channel
NOTE: The callback and invalidateKey are stored in refs to prevent subscription recreation on every render when inline functions/arrays are used.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options | UseRealtimeOptions |
Returns
Section titled “Returns”object
| Name | Type | Default value |
|---|---|---|
channel | RealtimeChannel | null | channelRef.current |