@join-com/routes
TypeScript icon, indicating that this package has built-in type declarations

1.3.2 • Public • Published

JOIN Routes

Routes generator lib for JOIN

Install

yarn add @join-com/routes

Usage

import { makeRoutes } from '@join-com/routes'

type RouteNames = 'root' | 'dashboard'

const routes = [
  {
    name: 'root',
    pattern: '/'
  },
  {
    name: 'root',
    locale: 'de-de',
    pattern: '/de-de'
  },
  {
    name: 'showJob',
    pattern: '/job/:jobId'
  },
  {
    name: 'showJob',
    locale: 'de-de',
    pattern: '/de-de/job/:jobId'
  }
]

const appRoutes = makeRoutes<RouteNames>({
  defaultLocale: 'en-us',
  routes
})

const rootUrl = appRoutes('root')()

const deRootUrl = appRoutes('root')({ locale: 'de-de' })

const jobUrl = appRoutes.showJob({ jobId: 1234 })

const deJobUrl = appRoutes.showJob({ locale: 'de-de', jobId: 1234 })

Readme

Keywords

none

Package Sidebar

Install

npm i @join-com/routes

Weekly Downloads

2

Version

1.3.2

License

UNLICENSED

Unpacked Size

12.8 kB

Total Files

20

Last publish

Collaborators

  • michal.adamski.join
  • gwozniak
  • jo-fr
  • rpasquay-join
  • roman_dronov
  • elgayar
  • kamill-szymanski-join
  • shankaranloganathan
  • reza-join
  • sosodope
  • maciejlaszkiewicz
  • eugenetaran
  • ddadonjoin
  • michal.baran
  • alaa-awad
  • szymonszklarskijoin
  • kevincharecki
  • dlljoin
  • ashraaf.ateef
  • yosri.mimouna
  • vitalii.pasiuta
  • join-dev
  • adam187
  • kirpichenkoo
  • tcichowicz
  • mayada
  • jakubspringer
  • readonly-user-join-com
  • 12m3r