Socket
Book a DemoInstallSign in
Socket

@berish/emitter

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@berish/emitter

Удобный механиз работы с событиями. Умеет кешировать запросы и подписки, за счет чего можно экономить ресурсы запросов

1.4.4
latest
npmnpm
Version published
Maintainers
1
Created
Source

@berish/emitter

The library allows you to conveniently work with events. Supports standard methods of working with events, also has additional functionality for working with cached requests

Installation

$ npm install @berish/emitter --save

or

$ yarn add @berish/emitter

Supports typescript

Interfaces

type SubscribeType<Data> = (data: Data) => void | Promise<void>;
type EventNameType = string | number;
type EventMapBaseType = {
  [eventName: string]: any;
  [eventName: number]: any;
};

interface IEventObject<Data> {
  eventName: EventNameType;
  eventHash: string;
  callback: SubscribeType<Data>;
}

Initialize

Syntax: class EventEmitter<EventMap extends EventMapBaseType>

Example:

import EventEmitter from '@berish/emitter';

const emitter = new EventEmitter();

Keywords

berish

FAQs

Package last updated on 25 Apr 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.