@@ -102,10 +102,11 @@ public static Task<IDocument> WhenStable(this Task<IDocument> documentTask) =>
102
102
/// <param name="documentTask">The document task to await.</param>
103
103
/// <param name="cancellation">The timeout cancellation, if any.</param>
104
104
/// <returns>A task that is finished when the document is available.</returns>
105
- public static async Task WaitUntilAvailable ( this Task < IDocument > documentTask , CancellationToken cancellation = default )
105
+ public static async Task < IDocument > WaitUntilAvailable ( this Task < IDocument > documentTask , CancellationToken cancellation = default )
106
106
{
107
107
var document = await documentTask . ConfigureAwait ( false ) ;
108
108
await document . WaitUntilAvailable ( cancellation ) . ConfigureAwait ( false ) ;
109
+ return document ;
109
110
}
110
111
111
112
/// <summary>
@@ -116,7 +117,7 @@ public static async Task WaitUntilAvailable(this Task<IDocument> documentTask, C
116
117
/// <param name="document">The document to await.</param>
117
118
/// <param name="cancellation">The timeout cancellation, if any.</param>
118
119
/// <returns>A task that is finished when the document is available.</returns>
119
- public static async Task WaitUntilAvailable ( this IDocument document , CancellationToken cancellation = default )
120
+ public static async Task < IDocument > WaitUntilAvailable ( this IDocument document , CancellationToken cancellation = default )
120
121
{
121
122
if ( document . ReadyState != DocumentReadyState . Complete )
122
123
{
@@ -126,6 +127,7 @@ public static async Task WaitUntilAvailable(this IDocument document, Cancellatio
126
127
}
127
128
128
129
await document . WhenStable ( ) . ConfigureAwait ( false ) ;
130
+ return document ;
129
131
}
130
132
}
131
133
}
0 commit comments