Nondeterministic Polynomial Munchies
Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

radi-router

0.4.1 • Public • Published

radi-router

radi-router is the official router for Radi.js. It deeply integrates with Radi for seamless application building.

npm version npm downloads gzip bundle size radi workspace on slack

Installation

To install the stable version:

npm install --save radi-router

This assumes you are using npm as your package manager.

If you're not, you can access these files on unpkg, download them, or point your package manager to them.

Browser Compatibility

radi-router currently is compatible with browsers that support ES6. In stable release v1 it will support ES5 compatible browsers and even some below that, yes - looking at IE8 too.

Documentation

Documentation is currently being written. For now just a few examples to work our appetite.

Foo bar routing example

/** @jsx r **/
import { r, use, mount, component } from 'radi'
import router from 'radi-router'
 
const index = component({
  view: function() { return <h1>Index</h1> }
});
 
const foo = component({
  view: function() { return <h1>Foo</h1> }
});
 
const RouterComponent = use({
  routes: {
    '/': index,
    '/foo': foo
  }
})
 
mount((
  <div>
    <a href="#/">index</a>
    <a href="#/foo">foo</a>
    <div>
      { new RouterComponent() }
    </div>
  </div>
), document.body);

Stay In Touch

License

MIT

Copyright (c) 2018-present, Marcis (Marcisbee) Bergmanis

install

npm i radi-router

Downloadsweekly downloads

11

version

0.4.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability