From 42337d85b6a21404ab9ecbc70b317f31a9cf47ad Mon Sep 17 00:00:00 2001 From: Arunoda Susiripala Date: Mon, 13 Mar 2017 05:26:10 +0530 Subject: [PATCH] Use a private Router event API for the ondemand-pinger. --- client/on-demand-entries-client.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/client/on-demand-entries-client.js b/client/on-demand-entries-client.js index a56e2a7234c53..3c4d9d384812f 100644 --- a/client/on-demand-entries-client.js +++ b/client/on-demand-entries-client.js @@ -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 {