Class CellExtensionMethods
- Namespace
- SodaFlow
- Assembly
- SodaFlow.dll
The operations available on a Cell<T>.
[PublicAPI]
public static class CellExtensionMethods
- Inheritance
-
CellExtensionMethods
- Inherited Members
Remarks
A cell is a behavior that also gives the stream of its own changes. Thus, it has everything in BehaviorExtensionMethods, and the operations that use those updates. Build the graph in a Run<T>(Func<T>), thus the listener gets the first firing. That is most important with Values<T>(Cell<T>), which always fires immediately.
Methods
- Apply<T, TResult>(Cell<T>, Cell<Func<T, TResult>>)
Apply a value in a cell to a function in a cell. This is the primitive for all function lifting.
- AsBehavior<T>(Cell<T>)
Return a reference to this Cell<T> as a Behavior<T>.
- Calm<T>(Cell<T>)
Return a cell whose stream only receives events which have a different value than the previous event.
- Calm<T>(Cell<T>, IEqualityComparer<T>)
Return a cell whose stream only receives events which have a different value than the previous event.
- Calm<T>(Cell<T>, Func<T, T, bool>)
Return a cell whose stream only receives events which have a different value than the previous event.
- Lift<T>(IEnumerable<Cell<T>>)
Lift into a collection of cells, so the returned cell always reflects a list of the input cells' values.
- Lift<T>(IReadOnlyCollection<Cell<T>>)
Lift into a collection of cells, so the returned cell always reflects a list of the input cells' values.
- Lift<T, TResult>(IEnumerable<Cell<T>>, Func<IReadOnlyList<T>, TResult>)
Lift a function into a collection of cells, so the returned cell always reflects the specified function applied to the input cells' values.
- Lift<T, TResult>(IReadOnlyCollection<Cell<T>>, Func<IReadOnlyList<T>, TResult>)
Lift a function into a collection of cells, so the returned cell always reflects the specified function applied to the input cells' values.
- Lift<T, T2, TResult>(Cell<T>, Cell<T2>, Func<T, T2, TResult>)
Lift a binary function into cells, so the returned cell always reflects the specified function applied to the input cells' values.
- Lift<T, T2, T3, TResult>(Cell<T>, Cell<T2>, Cell<T3>, Func<T, T2, T3, TResult>)
Lift a ternary function into cells, so the returned cell always reflects the specified function applied to the input cells' values.
- Lift<T, T2, T3, T4, TResult>(Cell<T>, Cell<T2>, Cell<T3>, Cell<T4>, Func<T, T2, T3, T4, TResult>)
Lift a quaternary function into cells, so the returned cell always reflects the specified function applied to the input cells' values.
- Lift<T, T2, T3, T4, T5, TResult>(Cell<T>, Cell<T2>, Cell<T3>, Cell<T4>, Cell<T5>, Func<T, T2, T3, T4, T5, TResult>)
Lift a 5-argument function into cells, so the returned cell always reflects the specified function applied to the input cells' values.
- Lift<T, T2, T3, T4, T5, T6, TResult>(Cell<T>, Cell<T2>, Cell<T3>, Cell<T4>, Cell<T5>, Cell<T6>, Func<T, T2, T3, T4, T5, T6, TResult>)
Lift a 6-argument function into cells, so the returned cell always reflects the specified function applied to the input cells' values.
- Lift<T, T2, T3, T4, T5, T6, T7, TResult>(Cell<T>, Cell<T2>, Cell<T3>, Cell<T4>, Cell<T5>, Cell<T6>, Cell<T7>, Func<T, T2, T3, T4, T5, T6, T7, TResult>)
Lifts a function of seven arguments into cells. The cell from this call always has the value of that function on the values of the input cells.
- Lift<T, T2, T3, T4, T5, T6, T7, T8, TResult>(Cell<T>, Cell<T2>, Cell<T3>, Cell<T4>, Cell<T5>, Cell<T6>, Cell<T7>, Cell<T8>, Func<T, T2, T3, T4, T5, T6, T7, T8, TResult>)
Lifts a function of eight arguments into cells. The cell from this call always has the value of that function on the values of the input cells.
- ListenStrong<T>(Cell<T>, Action<T>)
Listen for updates to the value of this cell, keeping the cell alive for as long as the returned listener is reachable. A disposal of the IStrongListener from this call stops the listener. This is an OPERATIONAL mechanism for the boundary between the world of I/O and FRP.
- Listen<T>(Cell<T>, Action<T>)
Listen for updates to the value of this cell, without keeping the cell alive. The returned IWeakListener. A call to Unlisten() stops the listener, and the listener also stops when a GC collects it. This is an OPERATIONAL mechanism for interfacing between the world of I/O and FRP.
- Map<T, TResult>(Cell<T>, Func<T, TResult>)
Transforms the values of a cell with the given function. The cell from this call has the value of that function on the value of the input cell.
- SampleLazy<T>(Cell<T>)
Sample the current value of the cell lazily.
- Sample<T>(Cell<T>)
Sample the current value of the cell.
- SwitchB<T>(Cell<Behavior<T>>)
Unwrap a behavior in a cell to give a time-varying behavior implementation.
- SwitchC<T>(Cell<Cell<T>>)
Unwrap a cell in a second cell to give a time-varying cell implementation.
- SwitchS<T>(Cell<Stream<T>>)
Unwrap a stream in a cell to give a time-varying stream implementation. At a change to the cell, the output stream fires the simultaneous firing, if there is one. That firing comes from the stream that the cell held at the start of the transaction.
- Updates<T>(Cell<T>)
Gets the stream of discrete updates to this cell.
- Values<T>(Cell<T>)
Gets the stream of values of this cell.