mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Use a private Router event API for the ondemand-pinger. (#1397)
This commit is contained in:
parent
02e697cb0d
commit
bb7c8f87c6
|
@ -3,11 +3,9 @@
|
|||
import Router from '../lib/router'
|
||||
import fetch from 'unfetch'
|
||||
|
||||
const originalRouteChangeComplete = Router.onRouteChangeComplete
|
||||
Router.onRouteChangeComplete = (...args) => {
|
||||
if (originalRouteChangeComplete) originalRouteChangeComplete(...args)
|
||||
ping()
|
||||
}
|
||||
Router.ready(() => {
|
||||
Router.router.on('routeChangeComplete', ping)
|
||||
})
|
||||
|
||||
async function ping () {
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue