Comparing version 6.0.1 to 6.0.2
{ | ||
"name": "wayfarer", | ||
"version": "6.0.1", | ||
"version": "6.0.2", | ||
"description": "Composable trie based router", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -57,19 +57,10 @@ # wayfarer [![stability][0]][1] | ||
### el = router.on(route, cb(params)) | ||
### router.on(route, cb(params)) | ||
Register a new route. The order in which routes are registered does not matter. | ||
Routes can register multiple callbacks. See | ||
[`routington.define()`](https://github.com/pillarjs/routington#nodes-node--routerdefineroute) | ||
for all route options. When called, the callback is passed a context object and | ||
any additional arguments from `router()`. The context object has the following | ||
properties: | ||
- __route__: the remaining route that wasn't matched | ||
Routes can register multiple callbacks. The callback can return values when | ||
called. | ||
### router(route) | ||
### val = router(route) | ||
Match a route and execute the corresponding callback. Alias: `router.emit()`. | ||
Accepts either a `route` string, or a context object with the following | ||
possible properties: | ||
- __route__: the route to be matched | ||
- __params__: an parameters object | ||
Any arguments passed after the `route/context` are passed as-is into the | ||
function handler. | ||
Returns a values from the matched route (e.g. useful for streams). | ||
@@ -76,0 +67,0 @@ ## Internals |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12031
118