createHref(path)

src/util.js

Function used to create HREFs that are properly namespaced

Parameters

  • string path :

    the HREF that will be appended to the current namespace

Returns

string :

a fully qualified HREF composed from the current namespace and the path provided

define(definitions)

src/definitionResolver.js

Function used to match the current route to a set of routes using switch-path

Parameters

  • Object definitions :

    Route definitions as expected by switch-path

Returns

Observable .< Object > :

an observable containing the path and value returned by switch-path. location as returned by @cycle/history and a createHref method for creating nested HREFs

makeRouterDriver(historyArgs)

src/makeRouterDriver.js

Instantiates an new router driver function using the same arguments required by @cycle/history.

Parameters

  • ... historyArgs :

Returns

routerDriver :

The router driver function

path(pathname)

src/pathFilter.js

Filters the current location to easily create nested routes

Parameters

  • string pathname :

    the route at which to filter

Returns

routerAPI

routerAPI

src/api.js

The Public API returned by the router driver, createRouter(), and .path()

Properties

  • path path :

    used for filtering routes to a given path

  • define define :

    used for defining a set of routes to values via switch-path

  • Observable .< location > observable :

    a way to get access to the current history$ from the historyDriver

  • createHref createHref :

    a method for create HREFs that are properly prefixed for the current namespace

  • function dispose :

    a method to dispose of the history$ returned by .observable

routerDriver(sink$)

src/makeRouterDriver.js

The actual router driver.

Parameters

  • Observable .< ( string | Object ) > sink$ :

    This is the same input that the history driver would expect.

Returns

routerAPI