Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@braintree/event-emitter
Advanced tools
A helper module for creating objects with event emitter capabilities.
npm
npm install --save @braintree/event-emitter
This module uses commonjs. You must use a build tool such as Browserify or Webpack to include it in your frontend project.
import EventEmitter from "@braintree/event-emitter";
class MyClass extends EventEmitter() {
// my class definition
}
const emitter = new MyClass();
emitter.on("event-name", function (data) {
console.log("called with", data.payload, "!");
});
emitter.emit("event-name", { payload: "foo" }); // logs "called with foo!"
const cb = function () {};
emitter.on("event-name", cb);
emitter.off("event-name", cb);
emitter.emit("event-name", { payload: "foo" }); // cb is not called
npm test
FAQs
A simple event emitter.
We found that @braintree/event-emitter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.