Skip to content

Commit

Permalink
update build
Browse files Browse the repository at this point in the history
  • Loading branch information
trusktr committed Oct 31, 2023
1 parent 639ca04 commit d760b21
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion api/core/Effectful.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@ class MyElement extends Effectful(HTMLElement) {
connectedCallback() {
// Log `foo` and `bar` any time either of them change.
this.createEffect(() => {
console.log('foo:', this.foo)
console.log('foo, bar:', this.foo, this.bar)
})

// Log only `bar` any time it changes.
this.createEffect(() => {
console.log('bar:', this.bar)
})
}

disconnectedCallback() {
// Stop both of the effects.
this.stopEffects()
}
}
Expand Down

0 comments on commit d760b21

Please sign in to comment.