Having a public send leads to the annoyance of anything that can watch an event can send data.
The way to get around this is to only give access to the send function to the creater of the event.
A way to do so API wise is to change event
function event(callback) {
var ev = new Event()
callback(function (data) {
send(ev, data)
})
return ev
}
event(function (next) {
elem.addEventListener("click", next)
})
Having a public send leads to the annoyance of anything that can watch an event can send data.
The way to get around this is to only give access to the
sendfunction to the creater of the event.A way to do so API wise is to change
event