Skip to content

Don't expose send #3

Description

@Raynos

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)
})

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions