@allain/surplus-router

0.1.2 • Public • Published

surplus-router

A simple router for use with Surplus

NPM

Install

npm install --save surplus-router

Example Usage

import * from Surplus from 'surplus'
import { Route } from 'surplus-router'

const view = <div>
    <Route path="/">
      <h1>Main Page</h1>
      <p><a href="#/test/123">Test 123</a></p>
      <p><a href="#/test/456">Test 456</a></p>
    </Route>
    <Route path="/test/:number">{({number}) => <p>Test {number}</p>}</Route>
  </div>;

document.body.appendChild(view); // add view to document

API

License

ISC © allain

Readme

Keywords

none

Package Sidebar

Install

npm i @allain/surplus-router

Weekly Downloads

189

Version

0.1.2

License

ISC

Unpacked Size

10.2 kB

Total Files

9

Last publish

Collaborators

  • allain