Skip to content

Instantly share code, notes, and snippets.

@vinitkumar
Created March 29, 2014 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vinitkumar/9849510 to your computer and use it in GitHub Desktop.
Save vinitkumar/9849510 to your computer and use it in GitHub Desktop.
proy.on("all", function (eventName) {
object.trigger(eventName);
});
book.on({
"change:title": titleView.update,
"change:author": authorPane.update,
"destroy": bookView.remove
});
// off object.off([event], ['callback', ['context'])
//
// remove just the 'onChange' callback
//
object.off("change", onChange);
// remove all change callbacks
object.off("change");
// Remove the `onchange` callbacks for all events
object.off(null, null, context);
// remoe all callbacks on '`object`'
object.off();
// listenTo
//
// tell an object to listen to a particular event.
view.listenTo(model, 'change', view.render);
view.stopListening();
view.stopListening(model);
view.listenToOnce(model, 'change', view.render);
add, remove, reset, sort, change, change:[attribute]
destroy, request, sync, error, invalid, route:[name]
route, all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment