Package Exports
- react-use-eventbus-z
- react-use-eventbus-z/build/index.esm.js
- react-use-eventbus-z/build/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-use-eventbus-z) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Description
- Wrapper event bus: eventbus-z
Usage
Install the package
npm install --save react-use-eventbus-z
Import the module in the place you want to use:
import { useEventBusOn, WrapEventBus } from 'react-use-eventbus-z';
Snippet
import { useEventBusOn, WrapEventBus } from 'react-use-eventbus-z';
const App = () => {
useEventBusOn('NAME', (abc, def) => {
alert('abcd');
})
return <Child />;
}
const Child = () => {
return <button onClick={() => WrapEventBus.sendEvent('NAME', 'abc', 1234)}>Abcd</button>
}
Events
See eventbus-z
RUN
License
MIT