1.0.2 • Published 5 years ago
cycle-micro-router v1.0.2
cycle-micro-router
A Cycle.js wrapper for handling routing.
It relies on the @cycle/history driver.
Installation
npm install --save cycle-micro-router
Usage
import router from 'cycle-micro-router';
// Components
import { Index } from './pages/index';
import { OtherPage } from './pages/OtherPage';
// Routing
const vdom$ = router({
sources: sources as any,
routes: {
'/': (sources: any) => Index(sources),
'/OtherPage': (sources: any) => OtherPage(sources),
},
errors: {
404: null // 404 error component
}
});