All Projects → router5 → Router5

router5 / Router5

Licence: mit
Flexible and powerful universal routing solution

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Router5

routex.js
🔼 Alternative library to manage dynamic routes in Next.js
Stars: ✭ 38 (-97.77%)
Mutual labels:  router, universal, routing
Next Routes
Universal dynamic routes for Next.js
Stars: ✭ 2,354 (+38.15%)
Mutual labels:  universal, router, routing
Falco
A functional-first toolkit for building brilliant ASP.NET Core applications using F#.
Stars: ✭ 214 (-87.44%)
Mutual labels:  router, routing, functional
react-mobx-router5
React components for routing solution using router5 and mobx
Stars: ✭ 58 (-96.6%)
Mutual labels:  router, routing, reactive-programming
Url Mapper
Take a URL and map to functions, parsing params
Stars: ✭ 39 (-97.71%)
Mutual labels:  router, routing
React Router Component
Declarative router component for React.
Stars: ✭ 879 (-48.42%)
Mutual labels:  router, routing
Restify Router
A router interface for restify that lets you aggregate route definitions and apply to a restify server
Stars: ✭ 45 (-97.36%)
Mutual labels:  router, routing
Bulb
A reactive programming library for JavaScript.
Stars: ✭ 84 (-95.07%)
Mutual labels:  reactive-programming, functional
Awesome Nextjs
📔 📚 A curated list of awesome resources : books, videos, articles about using Next.js (A minimalistic framework for universal server-rendered React applications)
Stars: ✭ 6,812 (+299.77%)
Mutual labels:  universal, routing
Siler
⚡ Flat-files and plain-old PHP functions rockin'on as a set of general purpose high-level abstractions.
Stars: ✭ 1,056 (-38.03%)
Mutual labels:  routing, functional
Lit Element Router
A LitElement Router (1278 bytes gzip)
Stars: ✭ 85 (-95.01%)
Mutual labels:  router, routing
Routing
The Routing component maps an HTTP request to a set of configuration variables.
Stars: ✭ 7,080 (+315.49%)
Mutual labels:  router, routing
Bidi
Bidirectional URI routing
Stars: ✭ 941 (-44.78%)
Mutual labels:  router, routing
Inferno Most Fp Demo
A demo for the ReactJS Tampa Bay meetup showing how to build a React+Redux-like architecture from scratch using Inferno, Most.js, reactive programmning, and various functional programming tools & techniques
Stars: ✭ 45 (-97.36%)
Mutual labels:  reactive-programming, functional
Storeon Async Router
Asynchronous router for Storeon. It provides possibility for prefetch the data, lazy load, navigation cancellation, and routes modification on the fly.
Stars: ✭ 22 (-98.71%)
Mutual labels:  router, routing
Corenavigation
📱📲 Navigate between view controllers with ease. 💫 🔜 More stable version (written in Swift 5) coming soon.
Stars: ✭ 69 (-95.95%)
Mutual labels:  router, routing
Php Router
simple and flexible Router class for PHP. with Controllers and Middlewares support.
Stars: ✭ 111 (-93.49%)
Mutual labels:  router, routing
Phprouter
PhpRouter is a powerful, minimal, and very fast HTTP URL router for PHP projects
Stars: ✭ 97 (-94.31%)
Mutual labels:  router, routing
React Page Layout
Create layouts for react
Stars: ✭ 117 (-93.13%)
Mutual labels:  router, routing
Django Macros Url
Django Macros URL. Routing must be simple as possible
Stars: ✭ 121 (-92.9%)
Mutual labels:  router, routing

Router5

npm version License: MIT Build Status Join the chat at https://gitter.im/router5/router5 styled with prettier

Official website: router5.js.org

router5 is a framework and view library agnostic router.

  • view / state separation: router5 processes routing instructions and outputs state updates.
  • universal: works client-side and server-side
  • simple: define your routes, start to listen to route changes
  • flexible: you have control over transitions and what happens on transitions
import createRouter from 'router5'
import browserPlugin from 'router5-plugin-browser'

const routes = [
  { name: 'home', path: '/' },
  { name: 'profile', path: '/profile' }
]

const router = createRouter(routes)

router.usePlugin(browserPlugin())

router.start()

With React (hooks)

import React from 'react'
import ReactDOM from 'react-dom'
import { RouterProvider, useRoute } from 'react-router5'

function App() {
  const { route } = useRoute()

  if (!route) {
    return null
  }

  if (route.name === 'home') {
    return <h1>Home</h1>
  }

  if (route.name === 'profile') {
    return <h1>Profile</h1>
  }
}

ReactDOM.render(
  <RouterProvider router={router}>
    <App />
  </RouterProvider>,
  document.getElementById('root')
)

With observables

Your router instance is compatible with most observable libraries.

import { from } from 'rxjs/observable/from'

from(router).map(({ route }) => {
  /* happy routing */
})

Examples

Docs

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].