0.2.0 • Published 3 years ago
routee v0.2.0
routee
The last router you'll ever need.
Installation
npm install routee
Usage
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');
API
Read the documentation for more information.
Contributing
- 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
License
Apache-2.0 © Eric MORAND