Revert init order change

This commit is contained in:
Carl Törnqvist
2019-04-03 10:51:41 +02:00
parent a22fca69de
commit 4c15924308
3 changed files with 2 additions and 43 deletions
+2 -2
View File
@@ -138,11 +138,11 @@ Choo.prototype.start = function () {
}
this._setCache(this.state)
this._matchRoute()
this._stores.forEach(function (initStore) {
initStore(self.state)
})
this._matchRoute()
this._tree = this._prerender(this.state)
assert.ok(this._tree, 'choo.start: no valid DOM node returned for location ' + this.state.href)
@@ -212,11 +212,11 @@ Choo.prototype.toString = function (location, state) {
var self = this
this._setCache(this.state)
this._matchRoute(location)
this._stores.forEach(function (initStore) {
initStore(self.state)
})
this._matchRoute(location)
var html = this._prerender(this.state)
assert.ok(html, 'choo.toString: no valid value returned for the route ' + location)
assert(!Array.isArray(html), 'choo.toString: return value was an array for the route ' + location)