Skip to content

Commit 07c0a87

Browse files
committed
update outwatch
1 parent 0dee518 commit 07c0a87

File tree

6 files changed

+7
-9
lines changed

6 files changed

+7
-9
lines changed

project/Deps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ object Deps {
5656
val scalarx = dep("com.github.cornerman.scalarx" %%% "scalarx" % "7daef55")
5757
// val scalarx = dep("com.github.fdietze.duality" %%% "scalarx" % "fc761c9")
5858
val outwatch = new {
59-
private val version = "eb744f78"
59+
private val version = "2a6a06aa"
6060
// val core = dep("io.github.outwatch" %%% "outwatch" % "0.11.1-SNAPSHOT")
6161
val core = dep("com.github.cornerman.outwatch" %%% "outwatch" % version)
6262
// val monix = dep("io.github.outwatch" %%% "outwatch-monix" % "0.11.1-SNAPSHOT")

webApp/src/main/scala/wust/webApp/state/GlobalState.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ import scala.util.Try
2727
object GlobalState {
2828
implicit val ctx: Ctx.Owner = Ctx.Owner.safe()
2929

30-
val isClientOnline = SourceStream.merge(Client.observable.connected.map(_ => true), Client.observable.closed.map(_ => false))
31-
.shareWithLatestSeed(false)
30+
val isClientOnline = SourceStream.merge(Client.observable.connected.map(_ => true), Client.observable.closed.map(_ => false)).behavior(false)
3231
//TODO: is browser does not trigger?!
33-
val isBrowserOnline = SourceStream.merge(events.window.onOffline.map(_ => false), events.window.onOnline.map(_ => true))
34-
.shareWithLatestSeed(false)
32+
val isBrowserOnline = SourceStream.merge(events.window.onOffline.map(_ => false), events.window.onOnline.map(_ => true)).behavior(false)
3533

3634
// register the serviceworker and get an update observable when serviceworker updates are available.
3735
val serviceWorkerIsActivated: SourceStream[Unit] = if (LinkingInfo.productionMode) ServiceWorker.register(WoostConfig.value.urls.serviceworker) else SourceStream.empty

webApp/src/main/scala/wust/webApp/views/Components.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ object Components {
628628
implicit ctx => handler => searchAndSelectNodeApplied[Handler](
629629
ProHandler(
630630
handler.edit.contramap[Option[NodeId]](EditInteraction.fromOption(_)),
631-
handler.edit.collect[Option[NodeId]] { case EditInteraction.Input(id) => Some(id) }.prepend(Some(node.id)).shareWithLatest,
631+
handler.edit.collect[Option[NodeId]] { case EditInteraction.Input(id) => Some(id) }.prepend(Some(node.id)).replayLatest
632632
),
633633
filter = (_:Node) => true
634634
),

webApp/src/main/scala/wust/webApp/views/EditableContent.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ object EditableContent {
213213
private def commonEditStructure[T](initial: Option[T], current: Handler[EditInteraction[T]], config: Config, handle: EditInteraction[T] => EditInteraction[T])(modifier: CommonEditHandler[T] => VDomModifier) = {
214214
val handledCurrent = ProHandler(
215215
current.contramap[EditInteraction[T]](handleEditInteraction[T](initial, config) andThen handle),
216-
current.filter(uniqueEditInteraction[T](initial)).shareWithLatest
216+
current.filter(uniqueEditInteraction[T](initial)).replayLatest
217217
)
218218

219219
val saveHandler = Handler.publish.unsafe[Unit]

webApp/src/main/scala/wust/webApp/views/FormView.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ object FormView {
171171
implicit ctx => handler => searchAndSelectNodeApplied[Handler](
172172
ProHandler(
173173
handler.edit.contramap[Option[NodeId]](EditInteraction.fromOption(_)),
174-
handler.edit.collect[Option[NodeId]] { case EditInteraction.Input(id) => Some(id) }.prepend(Some(node.id)).shareWithLatest,
174+
handler.edit.collect[Option[NodeId]] { case EditInteraction.Input(id) => Some(id) }.prepend(Some(node.id)).replayLatest
175175
),
176176
filter = (n:Node) => true,
177177
),

webApp/src/main/scala/wust/webApp/views/LeftSidebar.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ object LeftSidebar {
262262
val isSynced = Rx {
263263
GlobalState.isSynced() && !GlobalState.isLoading()
264264
}
265-
SourceStream.combineLatest(GlobalState.isClientOnline.distinctOnEquals)(isSynced)
265+
SourceStream.combineLatest(GlobalState.isClientOnline.distinctOnEquals, isSynced)
266266
}
267267

268268
val syncStatusIcon = status.map { status =>

0 commit comments

Comments
 (0)