Standard Router Driver for Motorcycle.js
Let me have it!
npm install --save @motorcycle/router
For all types not defined here, please refer to
Router(sinks: HistorySources): RouterSources
This is the main API of this driver. This function simply wraps
and returns a source object containing methods instead of a stream.
A convenience function, to more declaratively define your routes to Components. It returns a stream of your currently matched Component. When using the router driver directly there is more flexibility. With the Router function, you must use routes to match to Components.
This is a type representation of the object passed into your main function.
history(): Stream<Location> - This method allows you to reach the underlying
stream provided by
path(pathname: Pathname): RouterSource - This method allows you to created
nested router instances, very much like
DOM.select() creates a new place in the
DOM tree to look for elements and events, this allows dynamically created routes
that can be matched that are decoupled from any parent routes.
define(routes: RouteDefinitions): Stream<DefineReturn> - This method takes
an object (anything supported by switch-path) of keys that represent your routes
and returns a stream with an object that repesents any matches.
createHref(path: Pathname): Pathname - This method allows you to create Hrefs
that are namespaced at any RouterSource instance.