kibu-australia / pushy

Clojurescript library for quick and easy HTML5 pushState
Eclipse Public License 1.0
223 stars 28 forks source link

figwheel app reloads, pushy doesn't fully pick up new routes #13

Closed featheredtoast closed 8 years ago

featheredtoast commented 8 years ago

Hi there!

It appears that reloading an application though figwheel doesn't quite re-initalize the pushy routing component. If I load the page, and change a route (triggering a figwheel reload, not a full page reload), it appears that the previous set of routes remain, despite a new pushy def.

It appears to dispatch on initial reload, but any further dispatching reverts to the old router.

It's probably a lack of knowledge, but it'd be nice to have an example if there's a hook in pushy that figwheel would need to reload properly. Do I have to cleanup anywhere? I'm using bidi as a router.

featheredtoast commented 8 years ago

Ah, after thinkering, this is a figwheel issue in reloading the app. On redefining the routes and pushy, we lose the ability to stop/unload the old js click event handlers, so the handlers are 'stale', even when using on-reload handlers..