JSPM

popstate

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q31307F
  • License MIT

Listen on popstate history events with Safari compatibility

Package Exports

  • popstate

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (popstate) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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