Severino is a very simple away to play with events.
"Cara, crachá. Cara, crachá." by Severino.
** Doesn't need a browser it runs on any environment.**
emitter.on(event, callback, once);
var emitter = Severino.wake();
emitter.on("Post.create", function() {
# do something
});
emitter.on("App.init", function() {
# do something only once
}
, true);emitter.once(event, callback);
emitter.once("App.init", function() {
# do something only once
})emitter.off(event, callback);
emitter.off("App.init", function() {
# do something
});
or
emitter.off("App.init");emitter.events();
severino.events("Post.create") # => return the function
or
severino.events() # => return the events listemitter.emit(event, parameters);
severino.emit("Post.create",
{
name: "Jhon Doe"
, age: 33
}
);
or
severino.emit("Post.create"); bower install severino.jsSeverino is available under the MIT license.