0.3.2 • Published 1 year ago

@quotquot/router v0.3.2

Weekly downloads
-
License
EUPL-1.2
Repository
-
Last release
1 year ago

Quotquot's URL router

This is a simple URL router for the browser that creates web components on demand. To use, simply install the package with:

npm install @quotquot/router

and import the module in your code:

import "@quotquot/router";

This will define four custom elements:

hash-router
default-route
pattern-route
static-route

which can be used to create web components on demand using rules such as:

<hash-router>
  <static-route element="app-homepage" path="" keep></static-route>
  <pattern-route element="app-foo" regexp="^#/foo/(?<id>\d+)/?$"></pattern-route>
  <pattern-route element="app-bar" regexp="^#/bar/(?<id>\d+)/?$"></pattern-route>
  <default-route>
    <h1>unknown page</h1>
  </default-route>
</hash-router>
0.3.2

1 year ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago