
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@zenstack/react-zen-bus
Advanced tools
React Zen Bus is a React binding for [Zen Bus](https://github.com/alaboudi/zen-bus).
React Zen Bus is a React binding for Zen Bus.
yarn add @zenstack/react-zen-bus
or
npm install @zenstack/react-zen-bus
useSubscribe(:eventBus, :eventToHandlerMap)The useSubscribe hooks allows your event handlers to subscribe to the event bus when your component mounts.
In addition, it will unsubscribe your handlers when the components unmount.
import {createEventBus, EventType, EventHandler} from "@zenstack/zen-bus";
import {useSubscribe} from "@zenstack/react-zen-bus";
const myTodoList = ['Clean Toilet'];
const addToList = (event) => myTodoList.push(event.title);
const logEvent = (event) => console.log(event);
const subscriptions: [EventType<any>, EventHandler<any>][] = [
["Todo Added", addToList],
["Todo Added", logEvent]
];
/**
* Once this component mounts, addToLis and logEvent will both
* susbcribe to the event bus and execute when an event of type "Todo Added" has been emitted.
* They both will unsubscribe from the event bus when the component unmounts.
*/
const MyComponent = () => {
useSubscribe(eventBus, subscriptions);
return (
<div>
...
</div>
);
}
FAQs
React Zen Bus is a React binding for [Zen Bus](https://github.com/alaboudi/zen-bus).
We found that @zenstack/react-zen-bus demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.

Product
Bringing supply chain security to the next generation of JavaScript package managers