observ-history
Observable interface to the browser history API
Install
$ npm install --save observ-history
Usage
var history = //=> current path history//=> pushState
API
history([listener])
-> function
Returns an unlisten function.
listener
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.
history.set(path)
-> undefined
Updates the history by calling pushState
.
License
MIT © Ben Drucker