reneviering / vanilla-ui-router

Simple vanilla JavaScript router
MIT License
48 stars 5 forks source link

Change API for disposing a route #17

Open reneviering opened 7 years ago

reneviering commented 7 years ago

At the moment you have to add a configuration property dispose which is called just before navigating to another route.

A common pattern for deregistering an event or for disposing something is invoking the return-value of the routehandler function, e.g.:

const routeHandler = () => {

   return () => {
       console.log('dispose.....');
   }
}