route-component

0.2.0 • Public • Published

route

Route implementation for client-side routers.

Installation

$ component install component/route

API

Route(path)

Initialize a Route with a path string or regexp.

Route#before(fn)

Add before fn used when the "page" is shown. This may be invoked any number of times.

Route#after(fn)

Assign after fn used to perform cleanup when an alternate "page" is shown. This may be invoked any number of times.

Route#call(type, [args])

Invoke callbacks of type with args array.

Route#match(path)

Match against the given path. Returns false or an array with params matched.

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.0
    7
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.0
    7
  • 0.1.0
    2
  • 0.0.2
    3
  • 0.0.1
    2

Package Sidebar

Install

npm i route-component

Weekly Downloads

8

Version

0.2.0

License

MIT

Last publish

Collaborators

  • tjholowaychuk