1.0.7 • Published 7 years ago

eventdispacher v1.0.7

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

EventDispacher

This is a package for event emitting.

how to use

var eventEmitter = require('eventdispacher')
var test = new eventEmitter.EventDispacher()
var con = function(event) {
        console.log(event.name)
    }
    /**只添加一次回调 */
test.once(this, 'once', con)
test.dispach('once', { name: 'once' })
test.dispach('once', { name: 'once' })

var add1 = function(event) {
    console.log(event.name)
}
test.addListener(this, 'add', add1)
var add2 = function(event) {
        console.log(event.name)
    }
    /**只添加一次回调 */
test.addListener(this, 'add', add2)
test.dispach('add', { name: 'add' })

test.removeListener('add', add1)
test.dispach('add', { name: 'add' })
test.clear()
test.dispach('add', { name: 'add' })
1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.2.0

10 years ago

0.1.0

10 years ago