JavaScriptExtensionsToTask Method |
Namespace: Microsoft.ClearScript.JavaScriptAssembly: ClearScript.Core (in ClearScript.Core.dll) Version: 7.4.5
Syntax public static Task<Object> ToTask(
this Object promise
)
<ExtensionAttribute>
Public Shared Function ToTask (
promise As Object
) As Task(Of Object)
public:
[ExtensionAttribute]
static Task<Object^>^ ToTask(
Object^ promise
)
[<ExtensionAttribute>]
static member ToTask :
promise : Object -> Task<Object>
Parameters
- promise Object
- The promise to convert to a task (see remarks).
Return Value
TaskObjectA task that represents the promise's asynchronous operation.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
Object. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Remarks
If the argument is a
Task<Object> instance,
this method returns it as is.
See Also