implement choo v5 API (#425)

* implement choo v5 API

* fix tests

* 5.0.0-3

* 4kb now

* bump nanomorph

* 5.0.0-4

* fix missing deps stuff

* 5.0.0-5

* fix travis

* fixup! oops standard

* chooexpose

* fix state passing

* fixup! update example

* fixup! incorporate feedback

* fixup! more docs

* fixup! even more docs
This commit is contained in:
Yoshua Wuyts
2017-03-21 03:00:45 +01:00
committed by GitHub
parent 6fc525fe05
commit 8e8e870d45
61 changed files with 807 additions and 2707 deletions
+20
View File
@@ -0,0 +1,20 @@
var document = require('global/document')
var window = require('global/window')
var assert = require('assert')
module.exports = history
// listen to html5 pushstate events
// and update router accordingly
// fn(str) -> null
function history (cb) {
assert.equal(typeof cb, 'function', 'sheet-router/history: cb must be a function')
window.onpopstate = function () {
cb({
pathname: document.location.pathname,
search: document.location.search,
href: document.location.href,
hash: document.location.hash
})
}
}