1.0.0 • Published 9 years ago

popstate v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

popstate Build Status

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