Method SampleLazy
- Namespace
- SodaFlow
- Assembly
- SodaFlow.dll
SampleLazy<T>(Behavior<T>)
Sample the current value of the behavior lazily.
public static Lazy<T> SampleLazy<T>(this Behavior<T> b)
Parameters
bBehavior<T>The behavior.
Returns
- Lazy<T>
A lazy value that gives the current value of the behavior.
Type Parameters
TThe type of the behavior.
Remarks
This is a variant of Sample<T>(Behavior<T>) that works with the BehaviorLoop<T> class when no code closed the behavior loop. Use it in code that is general sufficient for a BehaviorLoop<T> argument. See HoldLazy<T>(Stream<T>, Lazy<T>).