An useEffect hook for lit-elements





!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.
``sh`
npm install lit-element-effect
`ts
@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])
}
``