mirror of
https://github.com/streamich/react-use.git
synced 2025-12-08 18:02:14 +00:00
297 B
297 B
useCallbag
React state hook that tracks the latest value of a callbag.
Usage
import {useCallbag} from 'react-use';
import interval from 'callbag-interval';
const Demo = () => {
const count = useCallbag(() => interval(1000));
return <span>{`Counter: ${count}`}</span>
};