Durandal constructor function but still want to remember data
Let's say I have the following durandal code: define(['durandal/app', 'plugins/http'], function (app) { var vm = function(){ var self = this; self.myData = ko.observableArray([]); } }; vm.activate = function() { this.myData([]); }; vm.deactivate = function(){ }; return vm; }; I know by returning a constructor function, every time the view model is activated, it will return a new instance. My question is: is there anyway that when I access, if there's myData() from previous access, then I don't want to set this.myData([]); but to use the previous myData() ? I know by returning a singleton