This package has been deprecated

Author message:

deprecated in favour of @issimo/add-history-listener

@sebastbake/add-history-listener
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

This package provides a simple api to subscribe to browser history events. It's the window.

size downloads npm GitHub

add-history-listener

This package provides a simple API to subscribe to browser history events.

const cleanup = addHistoryListener((prev, next) => {
  console.log(next);
});

history.replaceState(42, undefined, "/somewhere#over-the-rainbow");
// Prints { state: 42, pathname: "/somewhere", hash: "#over-the-rainbow", ...other useful things}

Readme

Keywords

none

Package Sidebar

Install

npm i @sebastbake/add-history-listener

Weekly Downloads

7

Version

2.0.0

License

MIT

Unpacked Size

4.32 kB

Total Files

5

Last publish

Collaborators

  • sebastbake