An open API service indexing awesome lists of open source software.

https://github.com/rubenmoya/emitter

A small event emitter with typescript
https://github.com/rubenmoya/emitter

Last synced: 4 months ago
JSON representation

A small event emitter with typescript

Awesome Lists containing this project

README

        

# Emitter
A small event emitter with typescript

```js
import Emitter from 'emitter'

const emitter = new Emitter()

// Listen to an event
emitter.on('myEvent', event => console.log('myEvent:', event) )

// Fire an event
emitter.emit('myEvent', { a: 'b' })

// Working with handler references:
function onEvent() {}
emitter.on('myEvent', onEvent) // listen
emitter.off('myEvent', onEvent) // unlisten
```