Skip to content

Commit

Permalink
fix typo in 14_create_effect.md (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthieuDartiailh authored Dec 4, 2024
1 parent 51b6149 commit 1dfe727
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/reactivity/14_create_effect.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Every time `count` is updated, this effect will rerun. This is what allows react

## Explicit Tracking with `Effect::watch()`

In addition to `Effect::new()`, Leptos provides an [`Effect::watch()`](https://docs.rs/leptos/0.7.0-gamma3/leptos/reactive/effect/struct.Effect.html#method.watch) function, which can be used to separate racking and responding to changes by explicitly passing in a set of values to track.
In addition to `Effect::new()`, Leptos provides an [`Effect::watch()`](https://docs.rs/leptos/0.7.0-gamma3/leptos/reactive/effect/struct.Effect.html#method.watch) function, which can be used to separate tracking and responding to changes by explicitly passing in a set of values to track.

`watch` takes a first argument, which is reactively tracked, and a second, which is not. Whenever a reactive value in its `deps` argument is changed, the `callback` is run. `watch` returns an `Effect`, which can be called with `.stop()` to stop tracking the dependencies.

Expand Down

0 comments on commit 1dfe727

Please sign in to comment.