public static IComputedState <T> NewComputed <T>( this IStateFactory factory, Func <IComputedState <T>, CancellationToken, Task <T> > computer) { var options = new ComputedState <T> .Options(); return(factory.NewComputed(options, computer)); }
public static IComputedState <T> NewComputed <T>( this IStateFactory factory, Action <ComputedState <T> .Options> optionsBuilder, Func <IComputedState <T>, CancellationToken, Task <T> > computer, object?argument = null) { var options = new ComputedState <T> .Options(); optionsBuilder.Invoke(options); return(factory.NewComputed(options, computer, argument)); }
public static IComputedState <T> NewComputed <T>( this IStateFactory factory, Result <T> initialOutput, Func <IComputedState <T>, CancellationToken, Task <T> > computer) { var options = new ComputedState <T> .Options() { InitialOutput = initialOutput, }; return(factory.NewComputed(options, computer)); }
public static IComputedState <T> NewComputed <T>( this IStateFactory factory, T initialValue, IUpdateDelayer updateDelayer, Func <IComputedState <T>, CancellationToken, Task <T> > computer) { var options = new ComputedState <T> .Options() { InitialValue = initialValue, UpdateDelayer = updateDelayer, }; return(factory.NewComputed(options, computer)); }
public static Exception WrongComputedState(ComputedState state) => new InvalidOperationException( $"Wrong Computed.State: {state}.");
public static Exception WrongComputedState( ComputedState expectedState, ComputedState state) => new InvalidOperationException( $"Wrong Computed.State: expected {expectedState}, was {state}.");
protected virtual void ConfigureState(ComputedState <TState> .Options options) { }
public static void DefaultAuthStateOptionsBuilder(ComputedState <AuthState> .Options options) => options.UpdateDelayer = UpdateDelayer.MinUpdateDelay with
protected override void ConfigureState(ComputedState <PainelComposedValue> .Options options) { options.UpdateDelayer = UpdateDelayer.MinDelay; }