JSFiddle - React, Tailwind, and code Playground
by ooflorent
JavaScript
function handle(e, data) {
console.log(e.data, data);
}
function myObj() {
this.raise = function() {
$(this).trigger("custom", {a: "a"});
}
}
var inst = new myObj();
$(inst).bind("custom", {b: "b"}, handle);
inst.raise();