From 3918ab7090fe083b404a0a0343a3a2c641a14e48 Mon Sep 17 00:00:00 2001 From: Scala Steward <43047562+scala-steward@users.noreply.github.com> Date: Fri, 10 Nov 2023 15:07:18 +0100 Subject: [PATCH] Update airstream to 16.0.0 (#324) * Update airstream to 16.0.0 * fix --------- Co-authored-by: johannes karoff Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- .../scala/colibri/ext/airstream/NoopOwner.scala | 4 ++-- .../scala/colibri/ext/airstream/package.scala | 17 +++++++---------- build.sbt | 2 +- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/airstream/src/main/scala/colibri/ext/airstream/NoopOwner.scala b/airstream/src/main/scala/colibri/ext/airstream/NoopOwner.scala index 971cd315..ab4824a1 100644 --- a/airstream/src/main/scala/colibri/ext/airstream/NoopOwner.scala +++ b/airstream/src/main/scala/colibri/ext/airstream/NoopOwner.scala @@ -1,10 +1,10 @@ package com.raquo.airstream.ownership.internalcolibri import com.raquo.airstream.ownership._ -import scala.scalajs.js +import com.raquo.ew.JsArray object NoopOwner extends Owner { - override protected[this] val subscriptions: js.Array[Subscription] = null + override protected[this] val subscriptions: JsArray[Subscription] = null override protected[this] def killSubscriptions(): Unit = () override protected[this] def onOwned(subscription: Subscription): Unit = () override private[ownership] def onKilledExternally(subscription: Subscription): Unit = () diff --git a/airstream/src/main/scala/colibri/ext/airstream/package.scala b/airstream/src/main/scala/colibri/ext/airstream/package.scala index af340e83..3467ef78 100644 --- a/airstream/src/main/scala/colibri/ext/airstream/package.scala +++ b/airstream/src/main/scala/colibri/ext/airstream/package.scala @@ -1,7 +1,6 @@ package colibri.ext -import com.raquo.airstream.core.{Observable, Observer} -import com.raquo.airstream.custom.{CustomSource, CustomStreamSource} +import com.raquo.airstream.core.{Observable, Observer, EventStream} import com.raquo.airstream.ownership.Subscription import com.raquo.airstream.ownership.internalcolibri.NoopOwner @@ -30,14 +29,12 @@ package object airstream { implicit object liftSource extends colibri.LiftSource[Observable] { def lift[H[_]: colibri.Source, A](source: H[A]): Observable[A] = { - val stream = CustomStreamSource[A] { (fireValue, fireError, _, _) => - var cancelable = colibri.Cancelable.empty - CustomSource.Config( - onStart = () => cancelable = colibri.Source[H].unsafeSubscribe(source)(colibri.Observer.create(fireValue, fireError)), - onStop = () => cancelable.unsafeCancel(), - ) - } - stream + var cancelable = colibri.Cancelable.empty + EventStream.fromCustomSource[A]( + start = (fireValue, fireError, _, _) => + cancelable = colibri.Source[H].unsafeSubscribe(source)(colibri.Observer.create(fireValue, fireError)), + stop = _ => cancelable.unsafeCancel(), + ) } } diff --git a/build.sbt b/build.sbt index 74e81ca7..4fd54144 100644 --- a/build.sbt +++ b/build.sbt @@ -124,7 +124,7 @@ lazy val airstream = project .settings( name := "colibri-airstream", libraryDependencies ++= Seq( - "com.raquo" %%% "airstream" % "0.14.5", + "com.raquo" %%% "airstream" % "16.0.0", ), )