backbone-eventbroker icon indicating copy to clipboard operation
backbone-eventbroker copied to clipboard

Having app events coming from the Router

Open mulderp opened this issue 11 years ago • 1 comments

I am exploring Backbone frameworks, and I saw something in Giraffe that looks interesting to me:

'someHashLocation/:andItsParams': 'some:appEvent'

Could events coming from URL changes automatically be translated into events of the EventBus?

PS I think the example is broken, I get a $ undefined

mulderp avatar Sep 22 '13 08:09 mulderp

Sure, though I wouldn't necessarily recommend coupling Router events to EventBroker events, and vice-versa. The two should remain mutually exclusive; a cleaner way to facilitate this would be to simply have the Router handle its events and forward them to corresponding EventBroker events, effectively fulfilling the use-case, while allowing the two to remain independent of one another, with only the Router having knowledge of the EventBroker.

efeminella avatar Feb 14 '14 18:02 efeminella