run choo event handlers first (#479)

This commit is contained in:
Yoshua Wuyts
2017-04-19 13:02:43 +02:00
committed by GitHub
parent 2cdf2dcdf0
commit 305d0a1ce5
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -62,14 +62,14 @@ function Choo (opts) {
}
})
bus.on('render', rerender)
bus.prependListener('render', rerender)
if (opts.history !== false) {
nanohistory(function (href) {
bus.emit('pushState')
})
bus.on('pushState', function (href) {
bus.prependListener('pushState', function (href) {
if (href) window.history.pushState({}, null, href)
bus.emit('render')
setTimeout(function () {
+1 -1
View File
@@ -24,7 +24,7 @@
"dependencies": {
"bel": "^4.5.1",
"document-ready": "^2.0.1",
"nanobus": "^3.0.0",
"nanobus": "^3.1.0",
"nanohistory": "^1.0.0",
"nanohref": "^1.0.0",
"nanomorph": "^4.0.0",