@nano-router/history

2.12.0 • Public • Published

@nano-router/history

Fork of the history package to support external navigation. Right now the two implementations is very close to each other, so documentation is still valid except for the additions.

This fork adds the following two methods:

pushLocation

This method will use window.location.assign to update the browser location.

history.pushLocation("https://www.example.com");

It support blocking the navigation like you would expect.

You can optionally provide a target, to open the location in another frame:

history.pushLocation("https://www.example.com", "_blank");

replaceLocation

This method will use window.location.replace to update the browser location.

history.replaceLocation("https://www.example.com");

It support blocking the navigation like you would expect.

Readme

Keywords

Package Sidebar

Install

npm i @nano-router/history

Weekly Downloads

11

Version

2.12.0

License

MIT

Unpacked Size

34.7 kB

Total Files

11

Last publish

Collaborators

  • sunesimonsen