
Research
/Security News
Shai Hulud Strikes Again (v2)
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.
@byteclaw/use-event-emitter
Advanced tools
React hooks and components for construction of simple event emitters
React hooks and components for construction of simple event emitters.
npm install @byteclaw/use-event-emitter
yarn add @byteclaw/use-event-emitter
Here is a quick example how to use these hooks.
import {
EventEmitterContext,
useEventEmitterInstance,
useEventEmitter,
} from '@byteclaw/use-event-emitter';
import React, { useEffect } from 'react';
function Comp() {
// returns the event emitter from the context
const eventEmitter = useEventEmitter();
useEffect(() => {
const unsubscribe = eventEmitter.on('test', (...args) => console.log(args));
return () => unsubscribe();
}, []);
}
function App({ children }) {
// returns the new instance of event emitter
const eventEmitter = useEventEmitterInstance();
return (
<EventEmitterContext.Provider value={eventEmitter}>
<Comp1 />
</EventEmitterContext.Provider>
);
}
FAQs
React hooks and components for construction of simple event emitters
We found that @byteclaw/use-event-emitter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.

Research
/Security News
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.

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

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.