These are chat archives for MetaStack-pl/MetaRx

8th
Feb 2016
Michal Sitko
@note
Feb 08 2016 09:07
I have question about stateful computations (especially when "state" is of different type than "input" of computation)
This message was deleted
This message was deleted
for now I do sth like this:
This message was deleted
val signals = Var[Unit]()

var active = true

val out = signals.map { _ =>
  active = !active
  active
}

out.attach(b => println("b: " + b))

signals.produce()
signals.produce()
signals.produce()
another solution is:
val signals = Var[Unit]()

    val active = Var[Boolean](true)

    signals.map { _ =>
      active.update(currentBool => !currentBool)
    }
Michal Sitko
@note
Feb 08 2016 09:16
So what I am trying to achieve is to have stream with intermittent true and false values based on Unit signal. Is it doable in some elegant way?