I'm using Durandal with Typescript.
My Viewmodel constructor is being called for every visit to that route. This seems like a waste. Shouldn't the state in the viewmodel be kept between different activations and then only the activate() on that instance will be called when the viewmodel is needed again?
Also, the viewmodel is still alive and running in memory after deactivation because I have some computedObservables that run code even though the user have left the viewmodel.
How do I avoid multiple constructions on the viewmodel - OR - how do I properly dispose the viewmodel after deactivation?