Skip to content

Commit

Permalink
Save as deps-and-runner
Browse files Browse the repository at this point in the history
  • Loading branch information
arniu committed Sep 8, 2022
1 parent 7468d4a commit e3d0220
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/yew/src/functional/hooks/use_effect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl<F: FnOnce() + 'static> TearDown for F {
}

struct UseEffectHook<T, F, D: TearDown> {
runner_with_deps: Option<(F, T)>,
deps_and_runner: Option<(T, F)>,
last_destructor: Option<D>,
last_deps: Option<T>,
}
Expand All @@ -41,7 +41,7 @@ where
fn rendered(&self) {
let mut this = self.borrow_mut();

if let Some((f, deps)) = this.runner_with_deps.take() {
if let Some((deps, f)) = this.deps_and_runner.take() {
if Some(&deps) == this.last_deps.as_ref() {
return;
}
Expand Down Expand Up @@ -215,7 +215,7 @@ where
D: TearDown,
{
UseEffectHook {
runner_with_deps: Some((f, deps)),
deps_and_runner: Some((deps, f)),
last_destructor: None,
last_deps: None,
}
Expand Down

0 comments on commit e3d0220

Please sign in to comment.