# use_effect_with

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-view/hooks/function-use_effect_with/

**function** · [`ferroui-view`](/docs/0.5.0/api/ferroui-view/) · v0.5.0

```rust
fn use_effect_with<D: PartialEq + 'static>(deps: D, f: impl FnOnce(&D) -> () + 'static)
```

Calls `f` with `deps` once the controls of the run are in place, on the
first run and on every run whose `deps` differ from those of the call
before. What `f` registers with `on_cleanup` runs
before the next call and when the component is taken out.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.View/hooks.rs#L200)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
