v2.0.1GitHub RepoNPM Package
@curi/interactions package provides a number of functions for interacting with Curi routes.
UMD scripts script are also available through Unpkg. You can access the package's exports using
An interaction function to generate a pathname string for a route.
If the route requires an params, they should be provided as the second argument to the function call.
The route to generate a pathname string for.
An object of params used to generate the pathname. If the route and/or any of its ancestor routes require params, then this argument must be provided.
An interaction function that uses a response object to determine if a route is "active".
The interaction requires two arguments, the first being the route data and the second being a response object.
The route to determine if it is active.
A response object emitted by the router.
An object with additional options
If the route requires params, these are the params that should be compared against the response's params.
When true (defaults to false), a route that is an ancestor of the response's route can be considered active if its params match the response's params.
A function to compare the other location components (
query) against the response's location.
An interaction function to get the ancestors of a route.
The interaction returns the public route data for each of the route's ancestors. The first item in the array is the root-most ancestor, while the last item in the array is the route's parent.
The route to get the ancestors of.
A function that will call a route's
The route to prefetch.
A route's resolve function is called with two arguments: the
match object for the matched route and an
externalvalue. You can provide filler values for these with the
optional object argument.
An object of "match" properties for the
resolve function. The possible properties are
Any external values passed to the
To access the
external values set on the router when it was created, you can use