public static async ValueTask <HttpRes> ThrowIfError(this ValueTask <HttpRes> task) { var res = await task.DonotCapture(); res.ThrowIfError(); return(res); }
public static async ValueTask <ActionEvent <T> > Error <T>(this ValueTask <ActionEvent <T> > @this, Func <Exception, Task> action) { var result = await @this.DonotCapture(); if (result.IsError) { await action(result.Exception); } return(result); }
public static async ValueTask <ActionEvent> Ok(this ValueTask <ActionEvent> @this, Action <object> action) { var result = await @this.DonotCapture(); if (result.IsOk) { action(result.Target); } return(result); }
public static async ValueTask <ActionEvent> Error(this ValueTask <ActionEvent> @this, Action <Exception> action) { var result = await @this.DonotCapture(); if (result.IsError) { action(result.Exception); } return(result); }
public static async ValueTask <ActionEvent <T> > Ok <T>(this ValueTask <ActionEvent <T> > @this, Func <T, Task> action) { var result = await @this.DonotCapture(); if (result.IsOk) { await action(result.Result); } return(result); }
public static async ValueTask <T> On <T>(this ValueTask <T> t, Func <T, bool> condition, Func <T, ValueTask> action) { var r = await t.DonotCapture(); if (condition(r)) { await action(r).DonotCapture(); } return(r); }
public static async ValueTask <ActionEvent <T> > ToExplicit <T>(this ValueTask <ActionEvent> @this) { var result = await @this.DonotCapture(); return(result.ToExplicit <T>()); }