Skip to content

Commit

Permalink
Reset state.components on toString
Browse files Browse the repository at this point in the history
  • Loading branch information
tornqvist committed Sep 13, 2018
1 parent 87a2d48 commit f95f8e0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ Choo.prototype.mount = function mount (selector) {
Choo.prototype.toString = function (location, state) {
state = state || {}
state.events = xtend(this._events)
state.components = state.components || {}

assert.notEqual(typeof window, 'object', 'choo.mount: window was found. .toString() must be called in Node, use .start() or .mount() if running in the browser')
assert.equal(typeof location, 'string', 'choo.toString: location should be type string')
Expand Down

0 comments on commit f95f8e0

Please sign in to comment.