Skip to content
This repository was archived by the owner on Jan 15, 2026. It is now read-only.

Commit 865967c

Browse files
Joy-lessAtlinx
authored andcommitted
Add ContinueWith overloads
1 parent 9797c9d commit 865967c

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

addons/GDTask/GDTaskExtensions.cs

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
using System.Collections;
3-
using System.Runtime.ExceptionServices;
1+
using System;
42
using System.Threading;
53
using System.Threading.Tasks;
64
using Fractural.Tasks.Internal;
@@ -687,6 +685,26 @@ public static async GDTask<TR> ContinueWith<T, TR>(this GDTask<T> task, Func<T,
687685
return await continuationFunction(await task);
688686
}
689687

688+
public static async GDTask ContinueWith<T>(this GDTask<T> task, Action continuationFunction) {
689+
await task;
690+
continuationFunction();
691+
}
692+
693+
public static async GDTask ContinueWith<T>(this GDTask<T> task, Func<GDTask> continuationFunction) {
694+
await task;
695+
await continuationFunction();
696+
}
697+
698+
public static async GDTask<TR> ContinueWith<T, TR>(this GDTask<T> task, Func<TR> continuationFunction) {
699+
await task;
700+
return continuationFunction();
701+
}
702+
703+
public static async GDTask<TR> ContinueWith<T, TR>(this GDTask<T> task, Func<GDTask<TR>> continuationFunction) {
704+
await task;
705+
return await continuationFunction();
706+
}
707+
690708
public static async GDTask ContinueWith(this GDTask task, Action continuationFunction)
691709
{
692710
await task;

0 commit comments

Comments
 (0)