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
Maintainers
1
Weekly downloads
405
increased by28.98%

Weekly downloads

Readme

Source

next-router-events

Build status npm version

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

Setup

To install next-router-events from npm run:

npm install next-router-events

Usage

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 27 Jun 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