File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
core/src/main/scala/japgolly/scalajs/react Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,12 @@ final class CallbackTo[A] private[react] (private[CallbackTo] val f: () => A) ex
239239 @ inline def << [B ](runBefore : CallbackTo [B ]): CallbackTo [A ] =
240240 runBefore >> this
241241
242+ def zip [B ](cb : CallbackTo [B ]): CallbackTo [(A , B )] =
243+ for {
244+ a <- this
245+ b <- cb
246+ } yield (a, b)
247+
242248 /**
243249 * Discard the value produced by this callback.
244250 */
Original file line number Diff line number Diff line change @@ -166,6 +166,12 @@ final class CallbackOption[A](private val cbfn: () => Option[A]) extends AnyVal
166166 _ <- next
167167 } yield a
168168
169+ def zip [B ](cb : CallbackOption [B ]): CallbackOption [(A , B )] =
170+ for {
171+ a <- this
172+ b <- cb
173+ } yield (a, b)
174+
169175 /**
170176 * Discard the value produced by this callback.
171177 */
You can’t perform that action at this time.
0 commit comments