igor-alexandrov / wiselinks

If Turbolinks are not enough for you. Wiselinks makes your application work faster.
MIT License
726 stars 93 forks source link

Provide old url in page:loading #84

Open felixbuenemann opened 9 years ago

felixbuenemann commented 9 years ago

It would be great if there was an event triggered before page:loading were document.location still points to the current url.

The problem is that when page:loading is triggered document.location already points to the new url, so it's hard to do cleanup like ubsubscribing from pubsub channels, calling deconstructors etc.

Turbolinks has a page:before-change event that can be used for that.

Another alternative would be to pass the old url to the page:loading event handler as an additional parameter.

tezzataz commented 9 years ago

+1