sealed trait RoutingRule[Page, Props] extends AnyRef

A single routing rule. Intended to be composed with other RoutingRules. When all rules are composed, this is turned into a RoutingRule.WithFallback instance.

Page

The type of legal pages. Most commonly, a sealed trait that you've created, where all subclasses represent a page in your SPA.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RoutingRule
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def modPath(onCreate: (Path) => Path, onParse: (Path) => Option[Path]): RoutingRule[Page, Props]

    Modify the path(es) generated and parsed by this rule.

    Modify the path(es) generated and parsed by this rule.

    onCreate

    Modify paths when generating for a route.

    onParse

    When parsing a path, transform and optionally reject it.

  2. abstract def pmapF[W](f: (Page) => W)(g: (W) => Option[Page]): RoutingRule[W, Props]
  3. abstract def xmap[A](f: (Page) => A)(g: (A) => Page): RoutingRule[A, Props]

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def addCondition(condition: (Page) => CallbackTo[Boolean]): RoutingRule[Page, Props]

    Prevent this rule from functioning unless some condition holds, passes in the page requested as part of the context.

    Prevent this rule from functioning unless some condition holds, passes in the page requested as part of the context.

    condition

    Function that takes the requested page and returns true if the page should be rendered.

  5. final def addCondition(condition: CallbackTo[Boolean]): RoutingRule[Page, Props]

    Prevent this rule from functioning unless some condition holds.

    Prevent this rule from functioning unless some condition holds.

    condition

    Callback that requested page and returns true if the page should be rendered.

  6. final def addConditionWithFallback(condition: (Page) => CallbackTo[Boolean], fallback: Action[Page]): RoutingRule[Page, Props]

    Prevent this rule from functioning unless some condition holds, passes in the page requested as part of the context.

    Prevent this rule from functioning unless some condition holds, passes in the page requested as part of the context. When the condition doesn't hold, a fallback action is performed.

    condition

    Function that takes the requested page and returns true if the page should be rendered.

    fallback

    Response when rule matches but condition doesn't hold.

  7. final def addConditionWithFallback(condition: CallbackTo[Boolean], fallback: Action[Page]): RoutingRule[Page, Props]

    Prevent this rule from functioning unless some condition holds.

    Prevent this rule from functioning unless some condition holds. When the condition doesn't hold, a fallback action is performed.

    condition

    Callback that requested page and returns true if the page should be rendered.

    fallback

    Response when rule matches but condition doesn't hold.

  8. final def addConditionWithOptionalFallback(condition: (Page) => CallbackTo[Boolean], fallback: Option[Action[Page]]): RoutingRule[Page, Props]

    Prevent this rule from functioning unless some condition holds, passes in the page requested as part of the context.

    Prevent this rule from functioning unless some condition holds, passes in the page requested as part of the context. When the condition doesn't hold, an optional fallback action may be performed.

    condition

    Function that takes the requested page and returns true if the page should be rendered.

    fallback

    Response when rule matches but condition doesn't hold. If response is None it will be as if this rule doesn't exist and will likely end in the route-not-found fallback behaviour.

  9. final def addConditionWithOptionalFallback(condition: CallbackTo[Boolean], fallback: Option[Action[Page]]): RoutingRule[Page, Props]

    Prevent this rule from functioning unless some condition holds.

    Prevent this rule from functioning unless some condition holds. When the condition doesn't hold, an optional fallback action may be performed.

    condition

    Callback that requested page and returns true if the page should be rendered.

    fallback

    Response when rule matches but condition doesn't hold. If response is None it will be as if this rule doesn't exist and will likely end in the route-not-found fallback behaviour.

  10. final def addConditionWithOptionalFallback(condition: (Page) => CallbackTo[Boolean], fallback: (Page) => Option[Action[Page]]): RoutingRule[Page, Props]

    Prevent this rule from functioning unless some condition holds, passes in the page requested as part of the context.

    Prevent this rule from functioning unless some condition holds, passes in the page requested as part of the context. When the condition doesn't hold, an optional fallback action may be performed.

    condition

    Function that takes the requested page and returns true if the page should be rendered.

    fallback

    Response when rule matches but condition doesn't hold. If response is None it will be as if this rule doesn't exist and will likely end in the route-not-found fallback behaviour.

  11. final def addConditionWithOptionalFallback(condition: CallbackTo[Boolean], fallback: (Page) => Option[Action[Page]]): RoutingRule[Page, Props]

    Prevent this rule from functioning unless some condition holds.

    Prevent this rule from functioning unless some condition holds. When the condition doesn't hold, an optional fallback action may be performed.

    condition

    Callback that requested page and returns true if the page should be rendered.

    fallback

    Response when rule matches but condition doesn't hold. If response is None it will be as if this rule doesn't exist and will likely end in the route-not-found fallback behaviour.

  12. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  13. final def autoCorrect(redirectVia: SetRouteVia): RoutingRule[Page, Props]

    When a route matches a page, compare its Path to what the route would generate for the same page and if they differ, redirect to the generated one.

    When a route matches a page, compare its Path to what the route would generate for the same page and if they differ, redirect to the generated one.

    Example: If a route matches /issue/dev-23 and returns a Page("DEV", 23) for which the generate path would be /issue/DEV-23, this would automatically redirect /issue/dev-23 to /issue/DEV-23, and process /issue/DEV-23 normally using its associated action.

  14. final def autoCorrect: RoutingRule[Page, Props]

    See autoCorrect().

  15. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  16. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  18. final def fallback(fallbackPath: (Page) => Path, fallbackAction: (Path, Page) => Action[Page]): WithFallback[Page, Props]

    Specify behaviour when a Page doesn't have an associated Path or Action.

  19. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  20. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  21. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  22. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. final def noFallback: WithFallback[Page, Props]

    When a Page doesn't have an associated Path or Action, throw a runtime error.

    When a Page doesn't have an associated Path or Action, throw a runtime error.

    This is the trade-off for keeping the parsing and generation of known Pages in sync - compiler proof of Page exhaustiveness is sacrificed.

    It is recommended that you call RouterConfig.verify as a sanity-check.

  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  26. final def pmap[W](f: (Page) => W)(pf: PartialFunction[W, Page]): RoutingRule[W, Props]
  27. final def pmapCT[W](f: (Page) => W)(implicit ct: ClassTag[Page]): RoutingRule[W, Props]
  28. final def prefixPath(prefix: String): RoutingRule[Page, Props]

    Add a prefix to the path(es) generated and parsed by this rule.

  29. final def prefixPath_/(prefix: String): RoutingRule[Page, Props]

    Add a prefix to the path(es) generated and parsed by this rule.

    Add a prefix to the path(es) generated and parsed by this rule.

    Unlike prefixPath() when the suffix is non-empty, a slash is added between prefix and suffix.

  30. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  31. def toString(): String
    Definition Classes
    AnyRef → Any
  32. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  33. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  34. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  35. final def widen[W >: Page](pf: PartialFunction[W, Page]): RoutingRule[W, Props]
  36. final def widenCT[W >: Page](implicit ct: ClassTag[Page]): RoutingRule[W, Props]
  37. final def widenF[W >: Page](f: (W) => Option[Page]): RoutingRule[W, Props]
  38. final def |(that: RoutingRule[Page, Props]): RoutingRule[Page, Props]

    Compose rules.

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped