mirror of
https://github.com/streamich/react-use.git
synced 2026-01-25 14:17:16 +00:00
380 B
380 B
u# useCallbag
React state hook that tracks the latest value of a callbag.
Requires use-callbag:
npm add use-callbag
# or
yarn add use-callbag
Usage
import {useCallbag} from 'react-use';
import interval from 'callbag-interval';
const Demo = () => {
const count = useCallbag(() => interval(1000));
return <span>{`Counter: ${count}`}</span>
};