Fold

rescala.operator.FoldBundle.Fold
object Fold

Folds when any one of a list of events occurs, if multiple events occur, every fold is executed in order.

Example for a counter that can be reset:

 Fold(0)(
   add act { x => current + v },
   reset act { _ => 0 }
 )

Attributes

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

Members list

Type members

Classlikes

class Branch[S](val staticDependencies: List[of[BundleState]], val isStatic: Boolean, val run: (DynamicTicket[BundleState]) => (FoldState[S]) ?=> S)

Attributes

Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply[T](init: => T)(branches: Branch[T]*)(using ticket: CreationTicket[BundleState]): Signal[T]
inline def branch[T](inline expr: (FoldState[T]) ?=> T): Branch[T]

Fold branches allow to define more complex fold logic

Fold branches allow to define more complex fold logic

Attributes