fix prev.location.params bug. closes #354 (#355)

This commit is contained in:
Tim Wisniewski
2016-12-11 15:45:46 -05:00
committed by GitHub
parent 08aa47c06f
commit 9af9b1ad37
+3 -3
View File
@@ -126,13 +126,13 @@ function choo (opts) {
const send = createSend('view: ' + route, true)
return function chooWrap (params) {
return function (state) {
const nwPrev = prev
prev = state
// TODO(yw): find a way to wrap handlers so params shows up in state
const nwState = xtend(state)
nwState.location = xtend(nwState.location, { params: params })
const nwPrev = prev
prev = nwState // save for next time
if (opts.freeze !== false) Object.freeze(nwState)
return handler(nwState, nwPrev, send)
}