Skip to content

Commit

Permalink
no default tear_down
Browse files Browse the repository at this point in the history
  • Loading branch information
hamza1311 committed Aug 28, 2022
1 parent bd2bfe4 commit f9fddc3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/yew/src/functional/hooks/use_effect.rs
Expand Up @@ -5,10 +5,12 @@ use crate::functional::{hook, Effect, Hook, HookContext};
/// Trait describing the destructor of [`use_effect`] hook.
pub trait TearDown: Sized + 'static {
/// The function that is executed when destructor is called
fn tear_down(self) {}
fn tear_down(self);
}

impl TearDown for () {}
impl TearDown for () {
fn tear_down(self) {}
}

impl<F: FnOnce() + 'static> TearDown for F {
fn tear_down(self) {
Expand Down

0 comments on commit f9fddc3

Please sign in to comment.