Match route before init stores (#698)
This commit is contained in:
@@ -142,11 +142,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)
|
||||
|
||||
@@ -220,11 +220,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)
|
||||
|
||||
Reference in New Issue
Block a user