com.raquo.waypoint
Type members
Classlikes
A builder for routes with context.
A builder for routes with context.
Context, in this context (heheh), is a type that encodes a set of query params that is shared between the routes created by this builder.
For example, your Laminar web app might have a big documentation section with many routes, but where every route is expected to have a "lang" query param to indicate the selected language and a "version" param to indicate the product version (unrealistic doc standards, I know).
So, you could add these two params to every page type that needs them and to every route for those page types, but that could be annoying. So instead, you could create a ContextRouteBuilder which will let you specify the necessary types / conversions / patterns only once.
See ContextRouteBuilderSpec for a concrete example.
- Type Params
- Bundle
- The type of pages (including the context part) handled by the routes produced by this builder.
A bundle consists of a route-specific Page, and a Context shared by all routes by this builder.
In the simplest case, imagine
case class Bundle(p: Page, ctx: Context)
- The type of pages (including the context part) handled by the routes produced by this builder.
A bundle consists of a route-specific Page, and a Context shared by all routes by this builder.
In the simplest case, imagine
- Ctx
- The part of the Bundle shared by all routes made by this builder,
In the simplest case, imagine
case class SharedParams(lang: Option[String], version: Option[String])
- The part of the Bundle shared by all routes made by this builder,
In the simplest case, imagine
- Page
- The base type for the route-specific parts of the Bundle
Encoding and decoding are partial functions. Their partial-ness should be symmetrical, otherwise you'll end up with a route that can parse a URL into a Page but can't encode the page into the same URL (or vice versa)
Encoding and decoding are partial functions. Their partial-ness should be symmetrical, otherwise you'll end up with a route that can parse a URL into a Page but can't encode the page into the same URL (or vice versa)
- Type Params
- Args
- Type of data saved in the URL for pages matched by this route Note: the Route might match only a subset of args of this type.
- Page
- Types of pages that this Route is capable of matching. Note: the Route might match only a subset of pages of this type.
- Value Params
- basePath
- This string is inserted after
origin
. If not empty, must start with/
.
- This string is inserted after
- decodePF
- Decode Args into Page, if args are valid
- matchEncodePF
- Match Any to Page, and if successful, encode it into Args
- Companion
- object
Types
A bundle of path args, query param args, and fragment args
A bundle of path args, query param args, and fragment args
Value members
Concrete methods
Inherited methods
Returns a Fragment imposing that the URL does not contain any fragment.
Returns a Fragment imposing that the URL does not contain any fragment.
Note that a URL ending with "#" is considered having no fragment.
- Inherited from
- FragmentImpl
Returns a Fragment matching an element of type T. If the fragment is missing, it fails with a missing fragment error.
Returns a Fragment matching an element of type T. If the fragment is missing, it fails with a missing fragment error.
- Inherited from
- FragmentImpl
- Inherited from
- QueryParametersImpl
Returns a Fragment matching an element of type T. If the fragment is missing, it succeeds with None.
Returns a Fragment matching an element of type T. If the fragment is missing, it succeeds with None.
- Inherited from
- FragmentImpl
- Inherited from
- PathSegmentImpl
- Inherited from
- QueryParametersImpl
- Inherited from
- PathSegmentImpl
Inherited fields
Implicits
Inherited implicits
- Inherited from
- FragmentImpl
- Inherited from
- PathSegmentImpl