final case class Conditional[Page, Props](condition: CallbackTo[Boolean], underlying: RoutingRule[Page, Props], otherwise: (Page) ⇒ Option[Action[Page]]) extends RoutingRule[Page, Props] with Product with Serializable
- Alphabetic
- By Inheritance
- Conditional
- Serializable
- Serializable
- Product
- Equals
- RoutingRule
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Conditional(condition: CallbackTo[Boolean], underlying: RoutingRule[Page, Props], otherwise: (Page) ⇒ Option[Action[Page]])
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
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.
- Definition Classes
- RoutingRule
-
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.
- Definition Classes
- RoutingRule
-
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.
- Definition Classes
- RoutingRule
-
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.
- Definition Classes
- RoutingRule
-
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
Noneit will be as if this rule doesn't exist and will likely end in the route-not-found fallback behaviour.
- Definition Classes
- RoutingRule
-
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
Noneit will be as if this rule doesn't exist and will likely end in the route-not-found fallback behaviour.
- Definition Classes
- RoutingRule
-
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
Noneit will be as if this rule doesn't exist and will likely end in the route-not-found fallback behaviour.
- Definition Classes
- RoutingRule
-
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
Noneit will be as if this rule doesn't exist and will likely end in the route-not-found fallback behaviour.
- Definition Classes
- RoutingRule
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
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-23and returns aPage("DEV", 23)for which the generate path would be/issue/DEV-23, this would automatically redirect/issue/dev-23to/issue/DEV-23, and process/issue/DEV-23normally using its associated action.- Definition Classes
- RoutingRule
-
final
def
autoCorrect: RoutingRule[Page, Props]
See autoCorrect().
See autoCorrect().
- Definition Classes
- RoutingRule
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
- val condition: CallbackTo[Boolean]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
fallback(fallbackPath: (Page) ⇒ Path, fallbackAction: (Path, Page) ⇒ Action[Page]): WithFallback[Page, Props]
Specify behaviour when a
Pagedoesn't have an associatedPathorAction.Specify behaviour when a
Pagedoesn't have an associatedPathorAction.- Definition Classes
- RoutingRule
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
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.
- Definition Classes
- Conditional → RoutingRule
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
noFallback: WithFallback[Page, Props]
When a
Pagedoesn't have an associatedPathorAction, throw a runtime error.When a
Pagedoesn't have an associatedPathorAction, throw a runtime error.This is the trade-off for keeping the parsing and generation of known
Pages in sync - compiler proof ofPageexhaustiveness is sacrificed.It is recommended that you call RouterConfig.verify as a sanity-check.
- Definition Classes
- RoutingRule
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- val otherwise: (Page) ⇒ Option[Action[Page]]
-
final
def
pmap[W](f: (Page) ⇒ W)(pf: PartialFunction[W, Page]): RoutingRule[W, Props]
- Definition Classes
- RoutingRule
-
final
def
pmapCT[W](f: (Page) ⇒ W)(implicit ct: ClassTag[Page]): RoutingRule[W, Props]
- Definition Classes
- RoutingRule
-
def
pmapF[W](f: (Page) ⇒ W)(g: (W) ⇒ Option[Page]): RoutingRule[W, Props]
- Definition Classes
- Conditional → RoutingRule
-
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.
- Definition Classes
- RoutingRule
-
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.
- Definition Classes
- RoutingRule
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- val underlying: RoutingRule[Page, Props]
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
widen[W >: Page](pf: PartialFunction[W, Page]): RoutingRule[W, Props]
- Definition Classes
- RoutingRule
-
final
def
widenCT[W >: Page](implicit ct: ClassTag[Page]): RoutingRule[W, Props]
- Definition Classes
- RoutingRule
-
final
def
widenF[W >: Page](f: (W) ⇒ Option[Page]): RoutingRule[W, Props]
- Definition Classes
- RoutingRule
-
def
xmap[A](f: (Page) ⇒ A)(g: (A) ⇒ Page): RoutingRule[A, Props]
- Definition Classes
- Conditional → RoutingRule
-
final
def
|(that: RoutingRule[Page, Props]): RoutingRule[Page, Props]
Compose rules.
Compose rules.
- Definition Classes
- RoutingRule
Deprecated Value Members
-
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.