Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Backbone.Wreqr vs Javascript Object

What are the main benefits backbone.wreqr has over a js object, both cases having access to marionette's Event aggregator.
Wouldn't assigning/calling methods from an object work the same way as Commands / RequestResponse. To me i see no need to implement this other than giving semantic/readability a +1.

https://github.com/marionettejs/backbone.wreqr
Can someone please enlighten me, this is my first backbone (and modular) application.

like image 208
Ricky Boyce Avatar asked Sep 29 '13 00:09

Ricky Boyce


Video Answer


1 Answers

The benefits are:

  • event and command handling is optional and you don't need to check manually yourself for undefineds
  • optionally multiple handlers for each event
  • lazy execution of commands (fire event first, register command later and it will immediately be executed)
  • you can define the scope of execution w/o using any additional methods like $.proxy, ...
like image 141
Creynders Avatar answered Oct 09 '22 14:10

Creynders