cerebral-legacy / cerebral-module-router

An opinionated URL change handler for Cerebral
http://cerebral-website.herokuapp.com/documentation/cerebral-module-router
19 stars 4 forks source link

How do I listen to every route change? #90

Closed awei01 closed 8 years ago

awei01 commented 8 years ago

Hi, is there some event emitter on the router that would allow me to tap into any route change?

Basically I'd want to use the URL to help manage application state (for highlighting links, changing panels, etc.)

Maybe I'm missing something, but the way I would go about this is to listen to route changes and then update some state. These changes would then propagate down to React UI.

Guria commented 8 years ago

Could you descrobe your case?

Guria commented 8 years ago

Just use signals bound to routes to set some state in tree.