Skip to content

paranatural/turntable

⬡ Turntable

Framework-agnostic flexible SPA router

⬡ Motivation/Promise

There are plenty of client-side routing libraries, but all of them aren't really lightweight and do not support middlewares or guards out-of-the-box

⬡ Features

⬡ Installation

npm i @paranatural/turntable @paranatural/turntable-stdlib @paranatural/turntable-react
yarn add @paranatural/turntable @paranatural/turntable-stdlib @paranatural/turntable-react
pnpm add @paranatural/turntable @paranatural/turntable-stdlib @paranatural/turntable-react

⬡ Usage/Utilizing/Enjoyment

import React from 'react'
import ReactDom from 'react-dom'
import { Ghostship } from '@ghostship/core'
import { GhostshipComponent } from '@ghostship/react'

import { HomePage, PostPage, NotFoundPage } from './components/pages'

const ghostship = new Ghostship(
  // routes tree
  [{
    path: '/',
    component: HomePage,
  }, {
    path: '/post/:slug',
    components: PostPage,
  }],
  // options
  {
    trailingSlash: true,
    notFound: NotFoundPage
  }
)

ReactDom.render(
  <GhostshipComponent instance={ghostship} />,
  document.getElementById('react')
)

⬡ API

⬡ Contribution

Feel free to open an issue/discussion with request/report, but ensure you read/follow Contributor Covenant Code of Conduct

⬡ Development/History

Changelog/Past/Versions

Roadmap/Future

⬡ Legal info

Project licensed under MIT License. What it means

⬡ Brand/Look

Project name, logo, visual design and writing style heavily inspired by Control game (made by Remedy Entertainment)

About

Framework-agnostic flexible SPA router

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy