Observable interface to the browser history API
$ npm install --save observ-history
var history = require('observ-history')
history(function (path) {
//=> (popstate)
})
history()
//=> current path
history.set(path)
//=> pushState
Returns an unlisten function.
Type: function
A function to call with the current path when the history changes and a popstate
event is fired. If no function is passed, the current path is returned.
Updates the history by calling pushState
.
MIT © Ben Drucker