Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@esroute/lit

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@esroute/lit

A small efficient client-side routing library for lit, written in TypeScript.

  • 0.9.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@esroute/lit

An integration of esroute into lit

This library provides a renderRoutes() directive to render the routes that are resolved by the router.

You can use the createRouter() factory to create the router instance.

Example

import { createRouter, renderRoutes } from "@esroute/lit";
import { html, LitElement } from "lit";
import { customElement } from "lit/decorators.js";

const router = createRouter({
  routes: {
    "": () =>
      import("./routes/root").then(() => html`<esroute-root></esroute-root>`),
    foo: {
      "*": ({ params: [name] }) =>
        import("./routes/foo").then(
          () => html`<my-greeter greeting=${name}></my-greeter>`
        ),
    },
  },
});

@customElement("my-demo")
export class Demo extends LitElement {
  render() {
    return html`${renderRoutes(router)}`;
  }
}

Keywords

FAQs

Package last updated on 16 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc