1
0
Эх сурвалжийг харах

feat: Manual impl of PartialEq for `Coroutine` (#2895)

Marc Espin 10 сар өмнө
parent
commit
e6efd973d8

+ 6 - 1
packages/hooks/src/use_coroutine.rs

@@ -110,7 +110,6 @@ pub fn use_coroutine_handle<M: 'static>() -> Coroutine<M> {
     use_hook(consume_context::<Coroutine<M>>)
 }
 
-#[derive(PartialEq)]
 pub struct Coroutine<T: 'static> {
     needs_regen: Signal<bool>,
     tx: CopyValue<Option<UnboundedSender<T>>>,
@@ -149,3 +148,9 @@ impl<T> Clone for Coroutine<T> {
         *self
     }
 }
+
+impl<T> PartialEq for Coroutine<T> {
+    fn clone(&self) -> Self {
+        self.needs_regen == other.needs_regen && self.tx == other.tx && self.task == other.task
+    }
+}