Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcisbee/radi-router
The official router for Radi.js.
https://github.com/marcisbee/radi-router
javascript radi radi-router router
Last synced: about 2 months ago
JSON representation
The official router for Radi.js.
- Host: GitHub
- URL: https://github.com/marcisbee/radi-router
- Owner: Marcisbee
- License: mit
- Created: 2018-02-12T10:23:40.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-04-05T09:13:25.000Z (over 1 year ago)
- Last Synced: 2024-11-14T00:02:26.236Z (about 2 months ago)
- Topics: javascript, radi, radi-router, router
- Language: JavaScript
- Homepage:
- Size: 224 KB
- Stars: 22
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# radi-router
`radi-router` is the official router for [Radi.js](https://radi.js.org). It deeply integrates with Radi for seamless application building.
[![npm version](https://img.shields.io/npm/v/radi-router.svg?style=flat-square)](https://www.npmjs.com/package/radi-router)
[![npm downloads](https://img.shields.io/npm/dm/radi-router.svg?style=flat-square)](https://www.npmjs.com/package/radi-router)
[![gzip bundle size](http://img.badgesize.io/https://unpkg.com/[email protected]/dist/radi-router.min.js?compression=gzip&style=flat-square)](https://unpkg.com/[email protected]/dist/radi-router.js)
[![discord](https://dcbadge.vercel.app/api/server/a62gfaDW2e?style=flat-square)](https://discord.gg/a62gfaDW2e)## Installation
To install the stable version:
```
npm install --save radi-router
```This assumes you are using [npm](https://www.npmjs.com/) as your package manager.
If you're not, you can [access these files on unpkg](https://unpkg.com/radi-router/dist/), 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
/** @jsx r **/
import { r, use, mount, component } from 'radi'
import router from 'radi-router'const index = component({
view: function() { returnIndex
}
});const foo = component({
view: function() { returnFoo
}
});const RouterComponent = use({
routes: {
'/': index,
'/foo': foo
}
})mount((
), document.body);
```## Stay In Touch
- [Twitter](https://twitter.com/radi_js)
- [Slack](https://join.slack.com/t/radijs/shared_invite/enQtMjk3NTE2NjYxMTI2LWFmMTM5NTgwZDI5NmFlYzMzYmMxZjBhMGY0MGM2MzY5NmExY2Y0ODBjNDNmYjYxZWYxMjEyNjJhNjA5OTJjNzQ)## License
[MIT](http://opensource.org/licenses/MIT)
Copyright (c) 2018-present, Marcis (Marcisbee) Bergmanis