Skip to content

Commit

Permalink
fix todolist buffering
Browse files Browse the repository at this point in the history
  • Loading branch information
rmgk committed Mar 10, 2024
1 parent 587db7d commit 922ecc8
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ object GlobalRegistry {
currentValues.foreach: (id, cw) =>
val enc = encode(id, cw.signal.now.state)(using cw.codec)
channels.foreach: chan =>
println(s"sending existing data for $id to new channel")
chan.send(enc).run(using ())(println)
}

Expand Down Expand Up @@ -90,7 +91,7 @@ object GlobalRegistry {
def publish[A](name: String, reactive: Signal[DeltaBuffer[Dotted[A]]])(using JsonValueCodec[Dotted[A]]) = {
println(s"publishing $name")

currentValues = currentValues.updated("name", Valued(reactive, summon))
currentValues = currentValues.updated(name, Valued(reactive, summon))

val initial = encode(name, reactive.now.state)
channels.foreach(c => c.send(initial).run(println))
Expand Down

0 comments on commit 922ecc8

Please sign in to comment.