Comparing version 0.0.21 to 0.0.22
@@ -25,19 +25,18 @@ "use strict"; | ||
this.transitor = new Transitor_1.Transitor(this.options.transitionStrategy); | ||
var historyNavigateHandler = function (newPath) { | ||
var oldPath = _this.history.currentPath; | ||
_this.processPath(newPath).then(function () { | ||
if (_this.onNavigate) { | ||
_this.onNavigate(oldPath, newPath); | ||
} | ||
}); | ||
}; | ||
switch (this.options.historyProvider) { | ||
case "virtual": | ||
this.history = new VirtualHistory_1.VirtualHistory(historyNavigateHandler); | ||
this.history = new VirtualHistory_1.VirtualHistory(function (newPath) { | ||
var oldPath = _this.history.currentPath; | ||
_this.processPath(newPath).then(function () { | ||
if (_this.onNavigate) { | ||
_this.onNavigate(oldPath, newPath); | ||
} | ||
}); | ||
}); | ||
break; | ||
case "hash": | ||
this.history = new HashHistory_1.HashHistory(historyNavigateHandler); | ||
this.history = new HashHistory_1.HashHistory(this.processPath.bind(this)); | ||
break; | ||
case "history": | ||
this.history = new BrowserHistory_1.BrowserHistory(historyNavigateHandler); | ||
this.history = new BrowserHistory_1.BrowserHistory(this.processPath.bind(this)); | ||
break; | ||
@@ -44,0 +43,0 @@ } |
{ | ||
"name": "steersman", | ||
"version": "0.0.21", | ||
"version": "0.0.22", | ||
"description": "Lightweight JS router for browsers & node", | ||
@@ -5,0 +5,0 @@ "main": "lib/Router.js", |
69213
1016