Fix location missing on store init (#695)

This commit is contained in:
Carl Törnqvist
2019-04-02 09:27:06 +02:00
committed by GitHub
parent 5921d27648
commit 6a2f14c292
2 changed files with 30 additions and 7 deletions
+1 -1
View File
@@ -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)