This is a router component for Mercury, a FRP JS framework based on the idea of tiny modules.
npm install mercury-router
Mecury Router looks for two state attributes:
base
– This attribute defines the base route of the routerroute
– This attribute defines the current/default route
router()
– initialise mercury router state in app staterouter.render(state:Object, routes:Object, fallback:Function)
– route path/view mapping in app renderrouter.anchor(attributes:Object, children:VTree|String)
– navigate viaa
html elementrouter.go(url:String)
– navigate to url directly
See example for a minimal working implementation.
- Created by @Raynos in https://gist.github.com/adbf7951bee3fdfe1a65
- @nikuda
- @twilson63
MIT LICENSE