xstream plugin for router5
npm install xstream-router5
xstream integration with router5
``sh`
npm install --save xstream-router5
_xstream-router5_ exports a single function createObservables:
`js
import createRouter from 'router5';
import createObservables from 'xstream-router5';
const router = createRouter([
{ name: 'home', path: '/home' },
{ name: 'about', path: '/about' }
]);
const {
route$,
routeNode,
transitionError$,
transitionRoute$
} = createObservables(router)
router.start();
route$.map((route) => { / ... / })
`
createObservables returns the following observables:route$
- : an observable of your application routetransitionRoute$
- : an observable of the currently transitioning routetransitionError$
- : an observable of transition errorsrouteNode(nodeName = '')`: a function returning an observable of route updates for the specified node
-