1.0.2 • Published 2 years ago

make-emitted v1.0.2

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

Small and simple event emitter


Size Dependecies count

Npm

Uses ES6 Proxies

Works pretty easy

import makeEmitted from 'make-emitted'

const someObject = {
  a: 5,
  pow2: (a) => a ** 2
}

const emitted = makeEmitted(someObject)

const id = emitted.on('pow2', () => console.log('pow2 method used'))

emitted.pow2() // pow2 method used
someObject.pow2() // Z-z-z
emitted.pow2() // pow2 method used

emitted.off(id)
emitted.pow2() // Z-z-z

Autocompletion by typescript

Autocompletion

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago