File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
core/src/main/scala/japgolly/scalajs/react Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,14 @@ final class CallbackOption[A](private val cbfn: () => Option[A]) extends AnyVal
188188 def void : CallbackOption [Unit ] =
189189 map(_ => ())
190190
191+ /**
192+ * Discard the value produced by this callback.
193+ *
194+ * This method allows you to be explicit about the type you're discarding (which may change in future).
195+ */
196+ @ inline def voidExplicit [B ](implicit ev : A =:= B ): Callback =
197+ void
198+
191199 def orElse (tryNext : CallbackOption [A ]): CallbackOption [A ] =
192200 CallbackOption (get flatMap {
193201 case a@ Some (_) => CallbackTo pure a
Original file line number Diff line number Diff line change 4040
4141* Add ` CallbackOption.{pass,fail} ` .
4242
43+ * Add ` Callback{,Option}.voidExplicit ` .
44+
4345* Add ` React.Children.toArray ` .
4446
4547* Upgrade React to 0.14.1. Adds new attributes:
You can’t perform that action at this time.
0 commit comments