-
Notifications
You must be signed in to change notification settings - Fork 147
machina.on
Jim Cowart edited this page Feb 2, 2015
·
2 revisions
description: subscribes an event listener to be notified of the specified event.
-
eventName
- string argument name to which you are subscribing (note: The only event currently emitted by themachina
namespace is thenewfsm
event). -
callback
- reference to the subscriber callback, or an anonymous function.
Example Usage:
// to subscribe
var callback = function(fsm) {
// does something with the fsm
};
var listener = machina.on("newfsm", callback);
// to unsubscribe:
machina.off("newfsm", callback);
// OR
listener.off();