1.0.2 • Published 3 years ago

lit-element-effect v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Effect hooks for Lit-Elements

Version Size vulnerabilities dependencies code quality Statements Branch Functions Lines

Two effect hooks, useOnce and useEffect, that can be used to trigger something only on first render, or when specific things change.

Installation

npm install lit-element-effect

Usage

@property()
prop: string | undefined;

render() {
    useOnce(this, () => {
        console.log("triggered once")
    })

    useEffect(this, () => {
        console.log("triggered each time this.prop changes.");
        console.log("Current Value: ", this.prop)
    }, [this.prop])
}
1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago