https://github.com/component/route
Route implementation for client-side routers
https://github.com/component/route
Last synced: 9 months ago
JSON representation
Route implementation for client-side routers
- Host: GitHub
- URL: https://github.com/component/route
- Owner: component
- Created: 2013-03-16T17:37:13.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2014-09-09T16:08:03.000Z (over 11 years ago)
- Last Synced: 2024-05-08T17:07:10.574Z (almost 2 years ago)
- Language: JavaScript
- Size: 152 KB
- Stars: 16
- Watchers: 13
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# 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