Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 297 Bytes

useCallbag.md

File metadata and controls

16 lines (11 loc) · 297 Bytes

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>
};