adobe master collection cs3 serial number tutorial
adobe master collection cs3 serial number registration code
adobe master collection cs3 serial number ssl
adobe master collection cs3 serial number 2010
adobe master collection cs3 serial number crack full version
adobe master collection cs3 serial number crackware
adobe master collection cs3 serial number download
adobe master collection cs3 serial number key
adobe master collection cs3 serial number for sale
adobe master collection cs3 serial number china
adobe master collection cs3 serial number activation
adobe master collection cs3 serial number download from microsoft
adobe master collection cs3 serial number for saleQ:
Can I have multiple 'dispatch' or 'leave' methods in the same view in Backbone.js?
I have a view that I want to have a single dispatcher in the initialize method and also to have a separate dispatcher to leave the view when the router is done navigating to another view.
I'm aware I can have multiple 'dispatch' methods, but how can I have multiple 'leave' methods?
Right now I have the following code, but this feels a bit messy to me and I'm not sure it's best practice:
initialize: function(){
this.bind("router:initialized", function(){
var self = this;
setTimeout(function(){
self.view.dispatch('leave');
}, 500);
});
},
A:
This is how I would do it.
"Dispatcher": function() {
return {
leave: function() {
//do stuff when leaving
}
};
}
"View": function() {
var dispatcher = this.get("dispatcher");
this.bind("router:initialized", function() {
dispatcher.leave();
});
return {
initialize: function() {
//...
},
// other methods be359ba680
Related links:
Comments