2.3.1 • Published 10 years ago

evently v2.3.1

Weekly downloads
1
License
-
Repository
github
Last release
10 years ago

evently

simpler faster lighter single-argument event-like function stacks for javascript

also available in a slightly faster singleton version

Build Status

Installation

$ npm install evently

Usage

var evently = require('evently');

var d = new evently.Dispatcher();

function log(a) {
    console.log("triggered with " + a);
}

d.on("a", log);
d.dispatch("a", [1, 2]); // "triggered with 1,2"

d.on("b", log);
d.off("b", log);
d.dispatch("b", "three"); // no effect

d.once('c', log);
d.dispatch("c", 4); // "triggered with 4"
d.dispatch("c", {a:5, b:6});

d.stopListening();
d.dispatch("a", [1, 2]); // no effect
d.dispatch("b", "three"); // no effect
d.dispatch("c", {a:5, b:6}); // no effect
2.3.1

10 years ago

2.3.0

10 years ago

2.2.1

10 years ago

2.2.0

10 years ago

2.1.4

10 years ago

2.1.2

11 years ago

2.1.1

11 years ago

1.1.0

11 years ago

1.0.0

11 years ago