RouterWithPropsConfigF

japgolly.scalajs.react.extra.router.RouterWithPropsConfigF
case class RouterWithPropsConfigF[F[_], Page, Props](rules: RoutingRulesF[F, Page, Props], renderFn: (RouterCtlF[F, Page], ResolutionWithProps[Page, Props]) => Props => VdomElement, postRenderFn: (Option[Page], Page, Props) => F[Unit], logger: Logger)(implicit effect: Sync[F])

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
RouterWithPropsConfigF[F, Page, Props]

Members list

Value members

Concrete methods

def detectErrors(pages: Page*): F[Seq[String]]

Check specified pages for possible route config errors, and returns any detected.

Check specified pages for possible route config errors, and returns any detected.

Note: Requires that Page#equals() be sensible. Note: If in production-mode (fullOptJS), this always returns an empty collection.

Attributes

Returns

Error messages (or an empty collection if no errors are detected).

def logToConsole: RouterWithPropsConfigF[F, Page, Props]
def logWith(l: Logger): RouterWithPropsConfigF[F, Page, Props]
def onPostRender[G[_]](f: (Option[Page], Page) => G[Unit])(implicit G: Dispatch[G]): RouterWithPropsConfigF[F, Page, Props]

Add an procedure to be performed after the router renders.

Add an procedure to be performed after the router renders.

Value parameters

f

Given the previous page and the current page that just rendered, return a callback.

Attributes

def onPostRenderP[G[_]](f: (Option[Page], Page, Props) => G[Unit])(implicit G: Dispatch[G]): RouterWithPropsConfigF[F, Page, Props]

Add an procedure to be performed after the router renders.

Add an procedure to be performed after the router renders.

Value parameters

f

Given the previous page, the current page that just rendered and props, return a callback.

Attributes

def renderWith(f: (RouterCtlF[F, Page], ResolutionWithProps[Page, Props]) => VdomElement): RouterWithPropsConfigF[F, Page, Props]

Specify how to render a page once it's resolved. This function will be applied to all renderable pages.

Specify how to render a page once it's resolved. This function will be applied to all renderable pages.

Attributes

def renderWithP(f: (RouterCtlF[F, Page], ResolutionWithProps[Page, Props]) => Props => VdomElement): RouterWithPropsConfigF[F, Page, Props]

Specify how to render a page once it's resolved. This function will be applied to all renderable pages.

Specify how to render a page once it's resolved. This function will be applied to all renderable pages.

Attributes

def setPostRender[G[_]](f: (Option[Page], Page) => G[Unit])(implicit G: Dispatch[G]): RouterWithPropsConfigF[F, Page, Props]

Specify (entirely) what to do after the router renders.

Specify (entirely) what to do after the router renders.

Value parameters

f

Given the previous page and the current page that just rendered, return a callback.

Attributes

def setPostRenderP[G[_]](f: (Option[Page], Page, Props) => G[Unit])(implicit G: Dispatch[G]): RouterWithPropsConfigF[F, Page, Props]

Specify (entirely) what to do after the router renders.

Specify (entirely) what to do after the router renders.

Value parameters

f

Given the previous page, the current page that just rendered and props, return a callback.

Attributes

def setTitle(f: Page => String): RouterWithPropsConfigF[F, Page, Props]

Change the document title after the router renders.

Change the document title after the router renders.

Value parameters

f

Given the current page that just rendered, return a new title.

Attributes

def setTitleOption(f: Page => Option[String]): RouterWithPropsConfigF[F, Page, Props]

Change the document title after the router renders.

Change the document title after the router renders.

Value parameters

f

Given the current page that just rendered, return potential new title.

Attributes

def setTitleOptionP(f: (Page, Props) => Option[String]): RouterWithPropsConfigF[F, Page, Props]

Change the document title after the router renders.

Change the document title after the router renders.

Value parameters

f

Given the current page that just rendered and props, return potential new title.

Attributes

def setTitleP(f: (Page, Props) => String): RouterWithPropsConfigF[F, Page, Props]

Change the document title after the router renders.

Change the document title after the router renders.

Value parameters

f

Given the current page that just rendered and props, return a new title.

Attributes

def verify(page1: Page, pages: Page*): RouterWithPropsConfigF[F, Page, Props]

Asserts that the page arguments provided, don't encounter any route config errors.

Asserts that the page arguments provided, don't encounter any route config errors.

If any errors are detected, the Router will be replaced with a new dummy router that displays the error messages.

If you want direct, programmatic access to the errors themselves, use detectErrors instead.

Note: Requires that Page#equals() be sensible. Note: If in production-mode (fullOptJS), this always returns this.

Attributes

Returns

In the event that errors are detected, a new RouterConfig that displays them; else this unmodified.

def withEffect[G[_]](implicit G: Sync[G]): RouterWithPropsConfigF[G, Page, Props]

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Implicits

Implicits

implicit val effect: Sync[F]