lihaoyi / scala.rx

An experimental library for Functional Reactive Programming in Scala
984 stars 79 forks source link

Update Var without triggering change propagation #174

Closed fbaierl closed 4 years ago

fbaierl commented 4 years ago

Is there currently a way to update a Var without triggering the change propagation?

E.g.:

val a = Var(1)
var count = 0
val o = a.triggerLater {
  count = a.now + 1
}
println(count) // 1
a.updateWithoutPropagation(4)
println(count) // 1
a.propagate()
println(count) // 5
fbaierl commented 4 years ago

I found out that this can be done using: Var.Assignment(a, 4).set(), so I am closing this issue.