From e6efd973d85bf6ce0d8635786f1c98b4c2b65e8e Mon Sep 17 00:00:00 2001 From: Marc Espin Date: Tue, 27 Aug 2024 22:03:33 +0200 Subject: [PATCH] feat: Manual impl of PartialEq for `Coroutine` (#2895) --- packages/hooks/src/use_coroutine.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/hooks/src/use_coroutine.rs b/packages/hooks/src/use_coroutine.rs index 347ec38fd..3a7016164 100644 --- a/packages/hooks/src/use_coroutine.rs +++ b/packages/hooks/src/use_coroutine.rs @@ -110,7 +110,6 @@ pub fn use_coroutine_handle() -> Coroutine { use_hook(consume_context::>) } -#[derive(PartialEq)] pub struct Coroutine { needs_regen: Signal, tx: CopyValue>>, @@ -149,3 +148,9 @@ impl Clone for Coroutine { *self } } + +impl PartialEq for Coroutine { + fn clone(&self) -> Self { + self.needs_regen == other.needs_regen && self.tx == other.tx && self.task == other.task + } +}