/// <summary> /// A stream that gives the updates/steps for a behavior. /// </summary> /// <typeparam name="T">The type of the values in the behavior.</typeparam> /// <param name="b"></param> /// <returns></returns> /// <remarks> /// This is an OPERATIONAL primitive, which is not part of the main Sodium /// API. It breaks the property of non-detectability of behavior steps/updates. /// The rule with this primitive is that you should only use it in functions /// that do not allow the caller to detect the behavior updates. /// </remarks> public static Stream <T> Updates <T>(Behavior <T> b) => Transaction.Apply( (trans, _) => b.Updates().Coalesce(trans, (left, right) => right), false);
/// <summary> /// A stream that is guaranteed to fire once upon listening, giving the current /// value of a behavior, and thereafter gives the updates/steps for the behavior. /// </summary> /// <typeparam name="T">The type of the values in the behavior.</typeparam> /// <param name="b"></param> /// <returns></returns> /// <remarks> /// This is an OPERATIONAL primitive, which is not part of the main Sodium /// API. It breaks the property of non-detectability of behavior steps/updates. /// The rule with this primitive is that you should only use it in functions /// that do not allow the caller to detect the behavior updates. /// </remarks> public static Stream <T> Value <T>(Behavior <T> b) => Transaction.Apply((trans, _) => b.Value(trans), false);
private CellSink(CellStreamSink <T> streamSink, Behavior <T> behavior) : base(behavior) => this.StreamSink = streamSink;