1.0.2 • Published 5 years ago

cycle-micro-router v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
5 years ago

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
    }
});
1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago