Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 595 Bytes

File metadata and controls

28 lines (19 loc) · 595 Bytes

Pathfinder

JS Event Emitter for browser navigation

Listens to window.click and window.popstate events for url navigation. Pathfinder will emit an event or callback for all internal navigation and prevents default behaviour for clicking a link.

npm install https://github.com/romeobravo/pathfinder

Examples

import Pathfinder from 'pathfinder'

const CHANGE = 'change'

pathfinder = new Pathfinder({
  event: CHANGE
})

pathfinder.on(CHANGE, function() {
  alert('navigation detected')
})

babel ./pathfinder.js --out-file ./lib/pathfinder.js --presets es2015