com.raquo.airstream.state

Type members

Classlikes

class DerivedVar[A, B](parent: Var[A], zoomIn: A => B, zoomOut: (A, B) => A, owner: Owner) extends Var[B]

DerivedVar has the same Var contract as SourceVar, but instead of maintaining its own state it is essentially a lens on the underlying SourceVar.

DerivedVar has the same Var contract as SourceVar, but instead of maintaining its own state it is essentially a lens on the underlying SourceVar.

This Var is active for as long as its signal has listeners. Being a StrictSignal, it already starts out with a subscription owned by owner, but even if owner kills its subscriptions, this Var's signal might have other listeners.

class DerivedVarSignal[A, B](parent: Var[A], zoomIn: A => B, owner: Owner) extends MapSignal[A, B] with OwnedSignal[B]
class ObservedSignal[A](val parent: Signal[A], observer: Observer[A], owner: Owner) extends MapSignal[A, A] with OwnedSignal[A]

This class adds a noop observer to signal, ensuring that its current value is computed. It then lets you query signal's current value with now and tryNow methods (see StrictSignal), as well as kill the subscription (see OwnedSignal)

This class adds a noop observer to signal, ensuring that its current value is computed. It then lets you query signal's current value with now and tryNow methods (see StrictSignal), as well as kill the subscription (see OwnedSignal)

trait OwnedSignal[+A] extends StrictSignal[A]
class SourceVar[A] extends Var[A]

The regular Var that's created with Var.apply.

The regular Var that's created with Var.apply.

See also DerivedVar, created with myVar.zoom(a => b)(b => a)(owner)

trait StrictSignal[+A] extends Signal[A]

A Signal that lets you directly query its current value.

A Signal that lets you directly query its current value.

This means that its current value is kept up to date regardless of observers. How this is actually accomplished is up to the concrete class extending this trait.

class Val[A](constantValue: Try[A]) extends WritableSignal[A] with StrictSignal[A]
Companion:
object
object Val
Companion:
class
trait Var[A] extends SignalSource[A] with Sink[A] with Named

Var is essentially a Signal that you can write to, so it's a source of state like EventBus is a source of events.

Var is essentially a Signal that you can write to, so it's a source of state like EventBus is a source of events.

There are two kinds of Vars: SourceVar and DerivedVar. The latter you can obtain by calling zoom(a => b, b => a) on a Var, however, unlike SourceVar, DerivedVar requires an Owner in order to run.

Companion:
object
object Var
Companion:
class