@morioh/r-bus
v1.0.3
Published
A global event emitter for React.
Downloads
4
Readme
useBus
A global event emitter for React
Install
npm i @morioh/r-bus
import useBus from "@morioh/r-bus";
const [data, setData] = useState(null);
useBus('show',(data) => { setData(data)}, [])
import { emit } from "@morioh/r-bus";
<button onCLick={()=> emit('show', {field:"value"})}>