1.0.3 • Published 6 years ago

@nichoth/catch-routes v1.0.3

Weekly downloads
7
License
ISC
Repository
github
Last release
6 years ago

catch routes

Listen for route changes and parse urls in the browser.

This is a higher level wrapper around route-event that handles url parsing as well.

install

$ npm install @nichoth/catch-routes

example

var catchRoutes = require('@nichoth/catch-routes')

var { setRoute } = catchRoutes(function onRoute (url) {
    console.log('href', url.href) //  => /some/path?foo=bar
    console.log('pathname', url.pathname) //  => /some/path
    console.log('query', url.query) //  => { foo: 'bar' }
})

// navigate programmatically
setRoute('/hello')
1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago