Skip to content

Latest commit

 

History

History
37 lines (24 loc) · 1.09 KB

README.md

File metadata and controls

37 lines (24 loc) · 1.09 KB

Mercury Router Build Status

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 router
  • route – This attribute defines the current/default route

Usage

  • router() – initialise mercury router state in app state
  • router.render(routes:Object) – route path/view mapping in app render
  • router.anchor(attributes:Object, children:VTree|String) – navigate via a html element
  • router.go(url:String) – navigate to url directly

See example for a minimal working implementation.

Contributors

License

MIT LICENSE