Socket
Socket
Sign inDemoInstall

next-router-events

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    next-router-events

A more powerful Next.js router events API.


Version published
Weekly downloads
714
decreased by-41.62%
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

2.0.0

  • Updated dependencies and peer dependencies.
  • No longer using Babel.
  • Simplified project structure with index.js at the project root, allowing removal of the package.json main field.
  • More efficient logic.
  • Removed support for the onAppUpdated hook deprecated in next@5.0.1-canary.7, fixing #1.
  • Prettier markdown.

Readme

Source

next-router-events

npm version Licence Github issues Github stars

A more powerful Next.js router events API. The standard API can only handle one listener per router event (see Next.js issue #2033).

Usage

Install with npm:

npm install next-router-events

To use router events:

import routerEvents from 'next-router-events'

const logUrl = url => console.log(url)
const alertUrl = url => alert(url)

routerEvents.on('routeChangeComplete', logUrl)
routerEvents.once('routeChangeComplete', alertUrl)
routerEvents.off('routeChangeComplete', logUrl)

See next router events and tiny-emitter instance methods.

Keywords

FAQs

Last updated on 23 Mar 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc