javascript - Merging Event definitions for mixins and Views backbone.js -


i've created mixin backbone , i'm wondering if there better way merge events hash.

mixin:

app.mixin.filter = { events: {     'click .label': 'toggle',     'keyup .file-search': 'updatesearchfilter' },  //more stuff } 

view:

app.dashboardview = backbone.view.extend({      el: '.contentwrap',      dashevents: {'click .project-btn': 'addprojectmodal'},      initialize: function() {      //other stuff      _.defaults(app.dashboardview.prototype.events, this.dashevents);      //other stuff      } }   _.extend(app.dashboardview.prototype, app.mixin.filter); 

i'm particularly not happy calling event hash dashevents. there way can keep events 'events'? or there standard pattern handle kind of issue?

app.dashboardview = backbone.view.extend({   el: '.contentwrap',   events : _.extend({}, app.mixin.filters.events, {     'click .project-btn': 'addprojectmodal'   }) } 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -