Route

japgolly.scalajs.react.extra.router.StaticDsl$.Route
final class Route[A](pattern: Pattern, parseFn: Matcher => Option[A], buildFn: A => Path) extends RouteCommon[Route, A], ForRoute[A]

A complete route.

Attributes

Graph
Supertypes
trait ForRoute[A]
class RouteCommon[Route, A]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def parse(path: Path): Option[A]
override def parseThen(f: Option[A] => Option[A]): Route[A]

Attributes

Definition Classes
def pathFor(a: A): Path
override def pmap[B](b: A => Option[B])(a: B => A): Route[B]

Prism map.

Prism map.

Some values of A can be turned into a Bs, some fail (in which case the route is considered non-matching).

All Bs can be turned back into As.

Attributes

Definition Classes
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any

Inherited methods

inline def caseClass[B <: Product](using m: ProductOf[B]): Route[B]

Maps the captures values of the route to a case class.

Maps the captures values of the route to a case class.

Attributes

Inherited from:
ForRoute
inline def caseClassDebug[B <: Product](using m: ProductOf[B]): Route[B]

Same as caseClass except the code generated by the macro is printed to stdout.

Same as caseClass except the code generated by the macro is printed to stdout.

Attributes

Inherited from:
ForRoute
final def const[B](b: B)(implicit ev: ValueOf[A]): R[B]

Attributes

Inherited from:
RouteCommon
final def filter(f: A => Boolean): R[A]

Attributes

Inherited from:
RouteCommon
final def mapInput[B >: A](f: B => A): R[B]

Attributes

Inherited from:
RouteCommon
final def mapParsed[B <: A](f: A => B): R[B]

Attributes

Inherited from:
RouteCommon
final def xmap[B](b: A => B)(a: B => A): R[B]

Exponential map.

Exponential map.

Any A can be turned into a B and vice versa.

Attributes

Inherited from:
RouteCommon