bite-sized front-end router.
$ npm install --save super-tiny-hash-router
CDN version: https://unpkd.com/super-tiny-hash-router/dist/
import createRouter from 'super-tiny-hash-router'
const router = createRouter()
router.add('/', () => {
renderHome()
})
router.add('*', () => {
render404()
})
// home router and 404 router are required before calling router.init()
router.init()
router.go('/user/egoist')
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D