Mercury Router [](https://travis-ci.org/twilson63/mercury-router)
April 20, 2016 · View on GitHub
This is a router component for Mercury, a FRP JS framework based on the idea of tiny modules.
Install
npm install mercury-router
API
Mecury Router looks for two state attributes:
base– This attribute defines the base route of the routerroute– This attribute defines the current/default route
Usage
router()– initialise mercury router state in app staterouter.render(routes:Object)– route path/view mapping in app renderrouter.anchor(attributes:Object, children:VTree|String)– navigate viaahtml elementrouter.go(url:String)– navigate to url directly
See example for a minimal working implementation.
Contributors
- Created by @Raynos in https://gist.github.com/adbf7951bee3fdfe1a65
- @nikuda
- @twilson63
License
MIT LICENSE