use-app-events
v1.6.4
Published
Event system for global communication in vanilla JavaScript and React.
Downloads
356
Maintainers
Readme
use-app-events
Event system for global communication in vanilla JavaScript and React.
📨 Send events and data from one part of the app to another.
📩 Listen for events to occur in the app and process their payload.
🌍 Organize and manage your global app state via events.
Facts
📦 Small package size
🍃 Tree-shakeable
📝 Well documented
🛡️ Strictly typed with TypeScript
♻️ Works between different browser tabs
🪝 Exports a convenient hook for React developers
Install
npm
npm install use-app-events
pnpm
pnpm add use-app-events
Exports
- notifyEventListeners
- Function to notify all listeners of the specified event type(s) subscribed via
listenForEvents
.
- Function to notify all listeners of the specified event type(s) subscribed via
- listenForEvents
- Function to subscribe and listen for the specified event type(s) to occur in the app.
- listenForEvents.once
- Function to subscribe and listen for the specified event type(s) to occur in the app once.
- useAppEvents
- Hook for managing application events in React.
- heap
- (readonly) Collection of resources operated by the package.
- options
- Collection of options used to adjust the behavior of the package.
This is a truncated version of README to reduce the package size.
[See full docs on GitHub]
License
MIT
Author
Maksym Marchuk