0.5.0 • Published 6 years ago

yaemit-fancy v0.5.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

yaemit

TravisCI Coverage Dependencies Dev Dependencies npm version MIT license

Install

npm --save install yaemit

Example

Direct usage of Emitter:

import Emitter from 'yaemit'

const e = new Emitter()
const fn = (input) => console.log('hello', input)

e.on('event', fn)
e.emit('event', 'world')

Context binding for the event handler:

e.on('event', handler.bind(context))

Emitter can be extended:

class Hello extends Emitter {
  constructor() {
    this.on('event', this.hello)
  }

  hello(input) {
    console.log('hello', input)
  }
}

(new Hello()).emit('event', 'world')
0.5.0

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.0

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago