0.0.6 • Published 5 years ago

onroutechange v0.0.6

Weekly downloads
10
License
MIT
Repository
github
Last release
5 years ago

onroutechange

The polyfill enables you to listen to route changes by customized window.onroutechange callback.

It's quite similar to window.onhashchange API, but for history.pushState. Could be useful for single-page applications.

Usage

Step1. Insert the following script tag into your webpage:

<script src="https://unpkg.com/onroutechange/dist/onroutechange.min.js"></script>

Step2. Register the window.onroutechange callback, for example:

window.onroutechange = function(state) {
  console.log('Route updated!');
};

License

MIT

0.0.6

5 years ago

0.0.5

6 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago