Module

match-best-route

This namespace is used to match path to routes. This is done during the server side render, client side hydration, and in the service worker

import { matchAllRoutes } from "@quintype/framework/isomorphic/match-best-route";

View Source isomorphic/match-best-route.js, line 1

Methods

# inner matchAllRoutes(path, routes) → {Array.<module:match-best-route~Route>}

Find all routes that match a given path

Parameters:
Name Type Description
path string

The current path

routes Array.<module:match-best-route~Route>

An array of routes to be matched

View Source isomorphic/match-best-route.js, line 36

Matching Routes

Type Definitions

# Route

Route represents a url pattern which is matched by the quintype framework. See Routing for more information on how the route is used.

{
 path: "/my-route/:routeParam",
 pageType: "home-page",
 exact: true,
 params: { foo: "bar" }
}
Properties:
Name Type Description
path string

The path that the route matches.

pageType string

The page type

exact boolean

Is this route an exact match or a prefix

View Source isomorphic/match-best-route.js, line 13