popstate
v1.0.0
Published
Listen on popstate history events with Safari compatibility
Downloads
10
Readme
popstate
Listen on popstate history events with Safari compatibility
Old versions of Chrome and all versions of Safari emit popstate
events on page load (MDN). popstate defers registration of the event listener to avoid double-calls.
Install
$ npm install --save popstate
Usage
var popState = require('popstate')
popState(function (event) {
//=> popped state
})
API
popState(callback)
-> undefined
callback
Required
Type: function
A callback to safely register for popstate
events.
License
MIT © Ben Drucker