New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

lit-element-effect

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lit-element-effect

An useEffect hook for lit-elements

latest
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

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])
}

FAQs

Package last updated on 23 Sep 2021

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