gluonjs-router
v0.0.1
Published
A minimal router
Downloads
2
Readme
gluon-router
A simple router exposed as an ES6 module. If enabled, it intercepts browser navigation to same-origin locations, and fires a callback instead.
Usage
import { onRouteChange } from '/src/gluon-router.js';
// This callback is fired whenever a navigation takes place, and passes the path, query parameters, and hash of the new location
onRouteChange((path, query, hash) => {
console.log("PATH: ", path);
console.log("QUERY: ", query);
console.log("HASH: ", hash);
});
About Gluonjs
Gluonjs is a minimal Web Component framework designed for simplicity and speed. It borrows some ideas from Polymer, but is mostly based on platform features. The source for the ES6 version is only ~40 lines of javascript.