Skip to content

listenFor

function listenFor(event, listener)
function listenFor(event, bundle, listener)

Listen for a given event to arrive and, when it does, invoke the listener with the payload of the event as an argument.

By default the event is listened for in the current bundle; to listen for events that were sent to some other bundle, pass that as the second argument to the function.