Skip to content

afeiship/next-url-watcher

Repository files navigation

next-url-watcher

Observe url changes for next.

version license size download

installation

npm install -S @jswork/next-url-watcher

apis

api params description
init ({ interval, immediate }) Initial a nx class.
watch callback Watch url change.

usage

import NxUrlWatcher from '@jswork/next-url-watcher';

const wather = new NxUrlWatcher({ immediate: true });

wather.watch((old, current) => {
  console.log(old, current);
});

license

Code released under the MIT license.