Skip to content

Commit

Permalink
Merge branch 'master' into init-stores-with-state
Browse files Browse the repository at this point in the history
* master:
  Update nanorouter (choojs#701)
  Use Object.assign instead of xtend (choojs#616)
  • Loading branch information
tornqvist committed Jun 11, 2019
2 parents d39ce9a + 0b4d578 commit 11e8ed0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ var nanohref = require('nanohref')
var nanoraf = require('nanoraf')
var nanobus = require('nanobus')
var assert = require('assert')
var xtend = require('xtend')

var Cache = require('./component/cache')

Expand Down Expand Up @@ -52,7 +51,7 @@ function Choo (opts) {
}
if (this._hasWindow) {
this.state = window.initialState
? xtend(window.initialState, _state)
? Object.assign({}, window.initialState, _state)
: _state
delete window.initialState
} else {
Expand Down Expand Up @@ -207,8 +206,8 @@ Choo.prototype.mount = function mount (selector) {

Choo.prototype.toString = function (location, state) {
state = state || {}
state.events = xtend(this._events)
state.components = state.components || {}
state.events = Object.assign({}, state.events, this._events)

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
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@
"nanomorph": "^5.1.2",
"nanoquery": "^1.1.0",
"nanoraf": "^3.0.0",
"nanorouter": "^3.0.1",
"nanorouter": "^4.0.0",
"nanotiming": "^7.0.0",
"scroll-to-anchor": "^1.0.0",
"xtend": "^4.0.1"
"scroll-to-anchor": "^1.0.0"
},
"devDependencies": {
"@tap-format/spec": "^0.2.0",
Expand Down

0 comments on commit 11e8ed0

Please sign in to comment.