Skip to content

Commit

Permalink
Reusable[Pot[A]].sequencePot
Browse files Browse the repository at this point in the history
  • Loading branch information
rpiaggio committed Dec 24, 2024
1 parent 199a942 commit 3b4f15c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/core/js/src/main/scala/crystal/react/syntax/pot.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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]] =
Expand Down

0 comments on commit 3b4f15c

Please sign in to comment.