Skip to content

Instantly share code, notes, and snippets.

@saumya
Last active August 29, 2015 13:55
Show Gist options
  • Save saumya/8755642 to your computer and use it in GitHub Desktop.
Save saumya/8755642 to your computer and use it in GitHub Desktop.
BackboneJS : Making an event dispatcher by extending Event
define('social/util',
['dependentLib'],
function(){
var myUtilLib = _.extend({
init: function(){
this.trigger("myUtilLib:init", "init message");
},
destroy: function(){
this.trigger("myUtilLib:destroy", "destroy message");
}
},Backbone.Events);
return myUtilLib;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment