RouterConfigDsl

japgolly.scalajs.react.extra.router.RouterConfigDsl
See theRouterConfigDsl companion object
final class RouterConfigDsl[Page, Props]

DSL for creating RouterConfig.

Instead creating an instance of this yourself, use RouterConfigDsl.apply.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Type members

Types

type Action = Action[Page, Props]
type Parsed = Parsed[Page]
type Redirect = Redirect[Page]
type Renderer = Renderer[Page, Props]
type Rule = RoutingRule[Page, Props]
type Rules = WithFallback[Page, Props]

Value members

Concrete methods

def dynRender[P <: Page, A](g: P => A)(implicit ev: A => VdomElement): P => Renderer
def dynRenderP[P <: Page, A](g: (P, Props) => A)(implicit ev: A => VdomElement): P => Renderer
def dynRenderR[P <: Page, A](g: (P, RouterCtl[Page]) => A)(implicit ev: A => VdomElement): P => Renderer
def dynRenderRP[P <: Page, A](g: (P, RouterCtl[Page], Props) => A)(implicit ev: A => VdomElement): P => Renderer
def dynamicRedirect[A](r: Route[A]): DynamicRedirectB[Page, Props, A, Rule]
def dynamicRoute[P <: Page](r: Route[P])(pf: PartialFunction[Page, P]): DynamicRouteB[Page, Props, P, Rule]
def dynamicRouteCT[P <: Page](r: Route[P])(implicit ct: ClassTag[P]): DynamicRouteB[Page, Props, P, Rule]
def dynamicRouteF[P <: Page](r: Route[P])(op: Page => Option[P]): DynamicRouteB[Page, Props, P, Rule]
def redirectToPage(page: Page)(implicit via: SetRouteVia): RedirectToPage[Page]
def redirectToPath(path: Path)(implicit via: SetRouteVia): RedirectToPath[Page]
def redirectToPath(path: String)(implicit via: SetRouteVia): RedirectToPath[Page]
def remainingPath: RouteB[String]

Captures the (non-empty) remaining portion of the URL path.

Captures the (non-empty) remaining portion of the URL path.

Attributes

Captures the (potentially-empty) remaining portion of the URL path.

Captures the (potentially-empty) remaining portion of the URL path.

Attributes

A rule that uses a replace-state redirect to remove leading slashes from route URLs.

A rule that uses a replace-state redirect to remove leading slashes from route URLs.

Attributes

Removes the query portion of the URL.

Removes the query portion of the URL.

e.g. a/b?c=1 to a/b

Attributes

A rule that uses a replace-state redirect to remove trailing slashes from route URLs.

A rule that uses a replace-state redirect to remove trailing slashes from route URLs.

Attributes

def render[A](a: => A)(implicit ev: A => VdomElement): Renderer
def renderP[A](g: Props => A)(implicit ev: A => VdomElement): Renderer
def renderR[A](g: RouterCtl[Page] => A)(implicit ev: A => VdomElement): Renderer
def renderRP[A](g: (RouterCtl[Page], Props) => A)(implicit ev: A => VdomElement): Renderer
def rewritePath(pf: PartialFunction[Path, Redirect]): Rule
def rewritePathF(f: Path => Option[Redirect]): Rule
def rewritePathR(r: Pattern, f: Matcher => Option[Redirect]): Rule
def root: Path
def staticRedirect(r: Route[Unit]): StaticRedirectB[Page, Props, Rule]
def staticRoute(r: Route[Unit], page: Page): StaticRouteB[Page, Props, Rule]

Note: Requires that Page#equals() be sensible.

Note: Requires that Page#equals() be sensible.

Attributes

def string(regex: String): RouteB[String]

Matches a string.

Matches a string.

Best to use a whitelist of characters, eg. "[a-zA-Z0-9]+". Do not capture groups; use "[a-z]+" instead of "([a-z]+)". If you need to group, use non-capturing groups like "(?:bye|hello)" instead of "(bye|hello)".

Attributes

A rule that uses a replace-state redirect to remove leading and trailing slashes from route URLs.

A rule that uses a replace-state redirect to remove leading and trailing slashes from route URLs.

Attributes

Concrete fields

val int: RouteB[Int]
val long: RouteB[Long]
lazy val queryToMap: RouteB[Map[String, String]]

Captures the query portion of the URL to a param map.

Captures the query portion of the URL to a param map.

Note that this is not a strict capture, URLs without a query string will still be accepted, and the parameter map will simply by empty.

Attributes

lazy val queryToMultimap: RouteB[Map[String, Seq[String]]]

Captures the query portion of the URL to a param multimap.

Captures the query portion of the URL to a param multimap.

Note that this is not a strict capture, URLs without a query string will still be accepted, and the parameter map will simply by empty.

Attributes

lazy val queryToSeq: RouteB[Seq[(String, String)]]

Captures the query portion of the URL.

Captures the query portion of the URL.

Note that this is not a strict capture, URLs without a query string will still be accepted, and the parameter map will simply by empty.

Attributes

val uuid: RouteB[UUID]

Implicits

Implicits

implicit def _auto_notFound_from_parsed[A](a: A)(implicit ev: A => Parsed): Path => Parsed
implicit def _auto_notFound_from_parsedF[A](f: Path => A)(implicit ev: A => Parsed): Path => Parsed
implicit def _auto_pToAction_from_action(a: => Action): Page => Action
implicit def _auto_parsedO_from_parsed[A](p: A)(implicit ev: A => Parsed): Option[Parsed]
implicit def _auto_parsedO_from_parsedO[A](o: Option[A])(implicit ev: A => Parsed): Option[Parsed]
implicit def _auto_parsed_from_page(p: Page): Parsed
implicit def _auto_pattern_from_regex(r: Regex): Pattern
implicit def _auto_routeB_from_path(p: Path): RouteB[Unit]
implicit def _auto_routeB_from_str(l: String): RouteB[Unit]
implicit def _auto_routeParser_from_parsed[A](a: A)(implicit ev: A => Parsed): Path => Option[Parsed]
implicit def _auto_routeParser_from_parsedF[A](f: Path => A)(implicit ev: A => Parsed): Path => Option[Parsed]
implicit def _auto_routeParser_from_parsedFO[A](f: Path => Option[A])(implicit ev: A => Parsed): Path => Option[Parsed]
implicit def _auto_routeParser_from_parsedO[A](o: Option[A])(implicit ev: A => Parsed): Path => Option[Parsed]
implicit def _auto_route_from_routeB[A, R](r: R)(implicit ev: R => RouteB[A]): Route[A]
implicit def _auto_rules_from_rulesB(r: Rule): Rules
implicit def _auto_someAction[A <: Action](a: A): Option[A]
implicit def _ops_for_routeb_option[A](r: RouteB[Option[A]]): RouteBO[A]