Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fbemitter

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fbemitter

Facebook's EventEmitter is a simple emitter implementation that prioritizes speed and simplicity. It is conceptually similar to other emitters like Node's EventEmitter, but the precise APIs differ. More complex abstractions like the event systems used on

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2M
decreased by-13.76%
Maintainers
3
Weekly downloads
 
Created

What is fbemitter?

The fbemitter package provides an implementation of the EventEmitter module that allows for managing and emitting events in a flexible manner. It's particularly useful in applications where components or modules need to communicate changes or actions to other parts of the application without being directly linked.

What are fbemitter's main functionalities?

EventEmitter

This feature allows you to create an event emitter, subscribe to events, and emit events. The code sample demonstrates creating an EventEmitter instance, subscribing to an event with a callback, emitting an event with data, and finally removing the subscription.

const {EventEmitter} = require('fbemitter');
const emitter = new EventEmitter();

function handleEvent(payload) {
  console.log('Event received:', payload);
}

const subscription = emitter.addListener('event-name', handleEvent);

emitter.emit('event-name', {some: 'data'});

// When the subscription is no longer needed
dubscription.remove();

Other packages similar to fbemitter

Keywords

FAQs

Package last updated on 09 Jan 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc