@analytics/router-utils

0.1.1 • Public • Published

Single Page Router utils

A tiny (584 bytes) routing utility for listening to route changes in single page applications.

Install

npm install @analytics/router-utils

Usage

import onRouteChange from '@analytics/router-utils'
import analytics from './analytics'

onRouteChange((newRoutePath) => {
  console.log('new route path', newRoutePath)
  // trigger page view
  analytics.page()
})

Package Sidebar

Install

npm i @analytics/router-utils

Weekly Downloads

1,633

Version

0.1.1

License

MIT

Unpacked Size

10.7 kB

Total Files

10

Last publish

Collaborators

  • davidwells