@keystone/emitter
emitter
Last updated 9 years ago by 75lb .
UNLICENSED · Original npm · Tarball · package.json
$ cnpm install @keystone/emitter 
SYNC missed versions from official npm registry.

emitter

Example

import Emitter from '@keystone/emitter'

class Something extends Emitter {}
const something = new Something()
something.on('load', () => {
  console.log('load event fired.')
})

Emitter ⏏

Kind: Exported class

emitter.emit(eventName)

Emit an event.

Kind: instance method of Emitter

Param Type Description
eventName string the event name to emit
...args * args to pass to the event handler

emitter.on(eventName, handler)

Register an event listener.

Kind: instance method of Emitter

Param Type Description
eventName string the event name to watch
handler function the event handler

emitter.removeEventListener(eventName, handler)

Remove an event listener.

Kind: instance method of Emitter

Param Type Description
eventName string the event name
handler function the event handler

Current Tags

  • 0.2.11                                ...           latest (9 years ago)

16 Versions

  • 0.2.11                                ...           9 years ago
  • 0.2.10                                ...           9 years ago
  • 0.2.9                                ...           9 years ago
  • 0.2.8                                ...           9 years ago
  • 0.2.7                                ...           9 years ago
  • 0.2.6                                ...           9 years ago
  • 0.2.5                                ...           9 years ago
  • 0.2.4                                ...           9 years ago
  • 0.2.3                                ...           9 years ago
  • 0.2.2                                ...           9 years ago
  • 0.2.1                                ...           9 years ago
  • 0.2.0                                ...           9 years ago
  • 0.1.6                                ...           9 years ago
  • 0.1.5                                ...           9 years ago
  • 0.1.4                                ...           9 years ago
  • 0.1.3                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (5)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |