How to use the @mapbox/batfish/modules/route-change-listeners.addRouteChangeEndListener function in @mapbox/batfish

To help you get started, we’ve selected a few @mapbox/batfish examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mapbox / batfish / examples / initial-experiments / src / pages / about / security.js View on Github external
description: blah blah blah
---*/
import React from 'react';
import {
  addRouteChangeStartListener,
  addRouteChangeEndListener
} from '@mapbox/batfish/modules/route-change-listeners';
import { PageShell } from '../../components/page-shell';
import { sharedImport } from '../../components/shared-import';
sharedImport();

addRouteChangeStartListener('/about/security/', pathname => {
  console.log(`${pathname} starting to load`);
});

addRouteChangeEndListener('/about/security/', pathname => {
  console.log(`${pathname} ending its load`);
});

class Security extends React.Component {
  render() {
    return security;
  }
}

export default Security;