on-url-change

Listen to url change events

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
on-url-change
001.0.27 years ago7 years agoMinified + gzip package size for on-url-change in KB

Readme

on-url-change
Listen to url change events
Why
There is no API for this, sadly.
Emits 'change' event on pushState or hash-change.

Usage

var onUrlChange = require('../');

var emitter = onUrlChange(/* Optional interval, default 50ms */);

emitter.on('change', function(url){
    console.log('URL changed to: ', url);
});

Tests

More like an example.
You need to run the page in a static server, due to file-system security issues.