The last router you'll ever need.
npm install routee
import {registerRoute, createURL, dispatch} from "routee";
const fooRoute = registerRoute('foo', ['id', 'name'], ({id, name}) => {
// this is the route executor
});
// create an URL from a route and its parameters
createURL(route, {
id: '1',
name: 'Bob'
});
// dispatch a location
const dispatchedRoute = dispatch('foo/bar/id/1/name/lorem');
Read the documentation for more information.
- Fork the main repository
- Code
- Implement tests using tape
- Issue a pull request keeping in mind that all pull requests must reference an issue in the issue queue
Apache-2.0 © Eric MORAND