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

# 1,043
JavaScr...
CSS
ghost
Node.js
87 commits
# 420,055
JavaScr...
HTML
virtual...
vdom
4 commits
# 114,627
Go
prometh...
cloudfl...
juniper
3 commits
# 1,379
JavaScr...
HTML
javascr...
angular...
2 commits
# 16,230
package...
Markdow...
angular...
angular...
2 commits
# 657,934
JavaScr...
1 commit
# 22,517
reactjs
Groovy
npm
yarn
1 commit
# 669,042
JavaScr...
1 commit
# 6,110
TypeScr...
probot-...
GitHub
coffees...
1 commit
# 109,486
Shell
CSS
nginx
nginx-c...
1 commit
# 226,969
Django
django-...
React
rust-cr...
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.