Skip to content

twilson63/mercury-router

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published