router5

WebJar for router5

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

router5
Последняя версия

Последняя версия

4.5.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

router5
WebJar for router5
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/router5/router5

Скачать router5

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/router5/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>router5</artifactId>
    <version>4.5.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/router5/
implementation 'org.webjars.npm:router5:4.5.2'
// https://jarcasting.com/artifacts/org.webjars.npm/router5/
implementation ("org.webjars.npm:router5:4.5.2")
'org.webjars.npm:router5:jar:4.5.2'
<dependency org="org.webjars.npm" name="router5" rev="4.5.2">
  <artifact name="router5" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='router5', version='4.5.2')
)
libraryDependencies += "org.webjars.npm" % "router5" % "4.5.2"
[org.webjars.npm/router5 "4.5.2"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.webjars.npm : route-node jar 1.8.2
org.webjars.npm : router5.transition-path jar 4.0.1

Модули Проекта

Данный проект не имеет модулей.

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

org.webjars.npm
JavaScript universal agnostic routing

Версии библиотеки

Версия
4.5.2