@morioh/r-bus
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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"})}>

Readme

Keywords

none

Package Sidebar

Install

npm i @morioh/r-bus

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

4.2 kB

Total Files

7

Last publish

Collaborators

  • nasa8x
  • jotarox