From 3b4f15ca2aba19f57961b5b9ba003dec413b2cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Piaggio?= Date: Tue, 24 Dec 2024 16:25:33 -0300 Subject: [PATCH] Reusable[Pot[A]].sequencePot --- modules/core/js/src/main/scala/crystal/react/syntax/pot.scala | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/core/js/src/main/scala/crystal/react/syntax/pot.scala b/modules/core/js/src/main/scala/crystal/react/syntax/pot.scala index aedc4d79..131ac41a 100644 --- a/modules/core/js/src/main/scala/crystal/react/syntax/pot.scala +++ b/modules/core/js/src/main/scala/crystal/react/syntax/pot.scala @@ -24,6 +24,10 @@ trait pot { case Pot.Ready(a) => f(a) case _ => EmptyVdom + extension [A](self: Reusable[Pot[A]]) + def sequencePot[B >: A]: Pot[Reusable[B]] = + self.value.map(self.withValue(_)) + given Reusability[Throwable] = Reusability.byRef[Throwable] given [A: Reusability]: Reusability[Pot[A]] =