Skip to content

Commit

Permalink
fix(router): pass params on newstate
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshuawuyts committed Dec 3, 2016
1 parent c0c5dce commit 44919f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function choo (opts) {
// create a new router with a custom `createRoute()` function
// (str?, obj) -> null
function createRouter (routerOpts, routes, createSend) {
var prev = {}
var prev = null
if (!routes) {
routes = routerOpts
routerOpts = {}
Expand All @@ -131,7 +131,7 @@ function choo (opts) {

// TODO(yw): find a way to wrap handlers so params shows up in state
const nwState = xtend(state)
nwState.location = xtend(nwPrev.location, { params: params })
nwState.location = xtend(nwState.location, { params: params })

if (opts.freeze !== false) Object.freeze(nwState)
return handler(nwState, nwPrev, send)
Expand Down

0 comments on commit 44919f9

Please sign in to comment.