From 305d0a1ce5cf982affbbb270c0213903a40e26ad Mon Sep 17 00:00:00 2001 From: Yoshua Wuyts Date: Wed, 19 Apr 2017 13:02:43 +0200 Subject: [PATCH] run choo event handlers first (#479) --- index.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index f395265..9f4743d 100644 --- a/index.js +++ b/index.js @@ -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 () { diff --git a/package.json b/package.json index 3a9f270..76f3f93 100644 --- a/package.json +++ b/package.json @@ -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",