Need help with minivents?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

allouis
410 Stars 42 Forks MIT License 128 Commits 0 Opened issues

Description

✨JavaScript events in 355 Bytes✨

Services available

!
?

Need anything else?

Contributors list

# 994
JavaScr...
CSS
ghost
Node.js
87 commits
# 429,476
CSS
virtual...
vdom
Rails
4 commits
# 54,984
Go
cloudfl...
juniper
C
3 commits
# 1,509
CSS
HTML
javascr...
angular...
2 commits
# 17,065
Markdow...
angular...
angular...
ecmascr...
2 commits
# 661,222
JavaScr...
1 commit
# 24,896
Groovy
npm
yarn
cpluspl...
1 commit
# 671,960
JavaScr...
1 commit
# 7,847
TypeScr...
probot-...
coffees...
probot
1 commit
# 117,828
Shell
CSS
HTML
nginx
1 commit
# 217,228
Django
React
rust-cr...
rust-la...
1 commit

minivents Build Status

http://allouis.github.io/minivents/

API

on
: Listen to event. Params { type:
String
, callback:
Function
| context:
Object
}. Returns
target
.

off
: Stop listening to event. Params { type:
String
| callback:
Function
}. Returns
target
.

emit
: Emit event. Params { type:
String
| data:
Object
}. Returns
target
.

Constructor Example

var sandbox = new Events();

sandbox.on("event", function(){ // do stuff });

sandbox.emit("event"); //does stuff

sandbox.off("event");

sandbox.emit("event"); //does not do stuff

Mixin Example

var sandbox = {
    otherStuff: true
};

Events(sandbox);

sandbox.on("event", function(){ // do stuff });

sandbox.emit("event"); //does stuff

sandbox.off("event");

sandbox.emit("event"); //does not do stuff

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.