0.1.9 • Published 2 years ago

lit-singleton v0.1.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years 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

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago