@dashkite/cordoba
v0.10.32
Published
Reactor-based application router based on the Navigation API
Readme
Cordoba
A reactive client-side router.
Cordoba is a reactive client-side router that leverages the browser-native Navigation API to provide a seamless routing experience. It uses event streams and a pipeline-based approach to navigation, allowing for flexible middleware and page management.
Installation
Use your favorite package manager:
npm install @dashkite/cordobaUsage
Cordoba expects a compatible page registry to be registered in the Registry under the name "application".
Initialize the router by calling run with optional hooks.
import Router from "@dashkite/cordoba"
# Optional hook for pre-navigation logic (e.g., authentication)
before = ( source ) ->
for await context from source
if isAuthorized context
yield context
else
# Redirect to login
application.navigate name: "login"
Router.run { before }Other Resources
Status
Not suitable for production use. Please report any issues on the GitHub repository.
