Skip to content

Commit 564f5c5

Browse files
committed
added use extension for eitherasync
1 parent a6bc428 commit 564f5c5

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/Dbosoft.Functional/UseExtensions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ namespace LanguageExt
99
{
1010
public static class UseExtensions
1111
{
12+
public static EitherAsync<L, R2> Use<L, R1, R2>(this EitherAsync<L, R1> self, Func<EitherAsync<L, R1>, EitherAsync<L, R2>> map) where R1 : IDisposable
13+
{
14+
var res = self.Bind(f => use(f, f1 => map(self)));
15+
return res;
16+
}
17+
1218
public static Task<Either<L, R2>> Use<L, R1, R2>(this Task<Either<L, R1>> self, Func<Task<Either<L, R1>>, Task<Either<L, R2>>> map) where R1 : IDisposable
1319
{
1420
var res = self.BindAsync(f => use(f, f1 => map(self)));

0 commit comments

Comments
 (0)