efeminella / backbone-eventbroker

An EventBroker for Backbone
MIT License
49 stars 11 forks source link

Having app events coming from the Router #6

Open mulderp opened 11 years ago

mulderp commented 11 years ago

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

efeminella commented 10 years ago

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.