0.1.0 • Published 8 years ago
super-tiny-hash-router v0.1.0
super-tiny-hash-router
bite-sized front-end router.
Install
$ npm install --save super-tiny-hash-router
CDN version: https://unpkd.com/super-tiny-hash-router/dist/
Usage
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')
Contributing
- 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
License
0.1.0
8 years ago