onStart

com.raquo.airstream.core.Transaction.onStart
object onStart

This object holds a queue of callbacks that should be executed when all observables finish starting. This lets signal.changes streams emit the updated signal's value when restarting, in such a way that the value propagates to all new observers instead of just the first new observer that triggered restart.

For that to happen, you need to wrap the code that's adding several observers into onStart.shared. We do this in a couple places in Airstream, and in a couple places in Laminar, and this seems to cover most reasonable use cases. Users might need to wrap some of their code into onStart.shared manually if they manage subscriptions manually.

See https://github.com/raquo/Airstream/#restarting-streams-that-depend-on-signals--signalchanges-

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
onStart.type

Members list

Value members

Concrete methods

def add(callback: Transaction => Unit): Unit

Add a callback to execute once the new shared transaction gets executed.

Add a callback to execute once the new shared transaction gets executed.

Value parameters

callback
  • Must not throw!

Attributes

def shared[A](code: => A, when: Boolean): A