Skip to content
zenui/react-hooks

useEventSource

Subscribe to a Server-Sent Events stream and keep the latest event in state. Use it for one-way server pushes such as notifications, progress updates and price tickers where a WebSocket would be more than you need.

Level
Intermediate
Since
v2.1.0
import {useEventSource} from '@zenuilabs/react-hooks';
Loading demo_

More in Realtime