1.0.18 • Published 2 years ago

@3xpo/events v1.0.18

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

@3xpo/events

repo image

documentation npm codeberg mit license mom made pizza mom made pizza build hopefully succeeded

Installation

pnpm i @3xpo/events

Usage

import EventEmitter from '@3xpo/events';

const emitter = new EventEmitter<{
  event1: (arg1: string, arg2: number) => void;
  event2: (arg1: string) => void;
}>();

emitter.on('event1', (arg1, arg2) => {
  console.log(arg1, arg2);
});

emitter.emit('event1', 'hello', 123);

Note

The EventEmitter is typesafe. If you want a non-typesafe eventemitter, either pass <any> or use NodeEventEmitter.

Note that typesafety is not available in pure JS.

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago