gvergnaud / nextjs-dynamic-routes

[Deprecated] Super simple way to create dynamic routes with Next.js
MIT License
140 stars 7 forks source link

Missing router events #7

Closed tychovbh closed 5 years ago

tychovbh commented 5 years ago

It would be nice to be able to use router events like in nextjs.

see: https://github.com/zeit/next.js/#router-events

so in this repo something like this:

import Router from ../routes'

const handleRouteChange = url => {
  console.log('App is changing to: ', url)
}

Router.events.on('routeChangeStart', handleRouteChange)
tychovbh commented 5 years ago

@gvergnaud Since I really need this now I created a pull request: https://github.com/gvergnaud/nextjs-dynamic-routes/pull/8

I hope you can take a look at it.

gvergnaud commented 5 years ago

Thank you for contributing! taking a look now

gvergnaud commented 5 years ago

Published on npm under v2.3.0. Thanks!