Skip to content
Jim Cowart edited this page Feb 2, 2015 · 2 revisions

machina.off

description: unsubscribes an event listener from being notified of the specified event.

machina.off( eventName [, callback] );

  • eventName - string argument name from which you are unsubscribing (note: the only event currently emitted by the machina namespace is the newfsm event).
  • callback - reference to the function that was used to subscribe

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();