0.0.6 • Published 4 years ago

onroutechange v0.0.6

Weekly downloads
10
License
MIT
Repository
github
Last release
4 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

4 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

6 years ago

0.0.1

6 years ago