0.1.9 • Published 1 year ago

lit-singleton v0.1.9

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Lit Singleton

A library to make singleton-like elements in lit

The issue

It's known that in a web page there are components that might only be required once at the time(e.g. alerts, snackbars)

And, by their nature, they need to be accesible in all parts of the code.

This library, helps you make singleton-like web components, ina fairly easy way

Installation

npm i lit-singleton

Usage

import { Singleton } from 'lit-singleton';
@customElement('web-component')
class WebComponent extends Singleton{
    static generator?: (() => LitElement) = () => (document.createElement('web-component') as LitElement);
}
0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago