Route

class Route[Page, Args]

Encoding and decoding are partial functions. Their partial-ness should be symmetrical, otherwise you'll end up with a route that can parse a URL into a Page but can't encode the page into the same URL (or vice versa)

Encoding and decoding are partial functions. Their partial-ness should be symmetrical, otherwise you'll end up with a route that can parse a URL into a Page but can't encode the page into the same URL (or vice versa)

Type Params
Args
  • Type of data saved in the URL for pages matched by this route Note: the Route might match only a subset of args of this type.
Page
  • Types of pages that this Route is capable of matching. Note: the Route might match only a subset of pages of this type.
Value Params
basePath
  • This string is inserted after origin. If not empty, must start with /.
decodePF
  • Decode Args into Page, if args are valid
matchEncodePF
  • Match Any to Page, and if successful, encode it into Args
Companion
object
class Object
trait Matchable
class Any

Value members

Concrete methods

def argsFromPage(page: Page): Option[Args]
def pageForAbsoluteUrl(origin: String, url: String): Option[Page]
Value Params
origin
Throws
Exception

when url is not absolute or is malformed, or in case of https://github.com/raquo/Waypoint#firefox-and-file-urls

def pageForRelativeUrl(origin: String, url: String): Option[Page]
Value Params
origin
Throws
Exception

when url is not relative, or in case of https://github.com/raquo/Waypoint#firefox-and-file-urls

def relativeUrlForPage(page: Any): Option[String]