1.0.0 • Published 2 years ago

@ionaru/typed-events v1.0.0

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

@ionaru/typed-events

npm version npm version Build Status

Description

A tiny package that provides a very simple event system with Typescript support.

Usage

npm install @ionaru/typed-events
import { TypedEvent } from '@ionaru/typed-events';

// Create a new event.
const myEvent = new TypedEvent<string>();

// Create a listener and subscribe to the event.
const listener = (message) => console.log(message);
myEvent.on(listener);

// Emit to notify all listeners.
myEvent.emit('Something happened!')

// console.log: 'Something happened!'
1.0.0

2 years ago

1.0.1-2.0

2 years ago

0.0.2-1.0

2 years ago

0.0.2-7.0

5 years ago

0.0.2-6.0

5 years ago

0.0.2-5.0

5 years ago

0.0.2-4.0

5 years ago

0.0.1

5 years ago