UNPKG

nanohistory

Version:
13 lines (10 loc) 298 B
var assert = require('assert') module.exports = history // listen to html5 pushstate events // and update router accordingly function history (cb) { assert.equal(typeof cb, 'function', 'nanohistory: cb must be type function') window.onpopstate = function () { cb(document.location) } }