ClearScript Library
ClearScript Library
ClearScript Library Reference
Microsoft.ClearScript.JavaScript
JavaScriptExtensions Class
JavaScriptExtensions Methods
ToAsyncEnumerable Method
ToEnumerable Method
ToPromise Method
ToTask Method

# JavaScriptExtensionsToAsyncEnumerable Method

Supports managed asynchronous iteration over an async-iterable script object.
Namespace: Microsoft.ClearScript.JavaScript
Assembly: ClearScript.Core (in ClearScript.Core.dll) Version: 7.5.0
Syntax
C#
VB
C++
F#
Copy

    public static IAsyncEnumerable<Object> ToAsyncEnumerable(
    	this Object asyncIterable
    )

    <ExtensionAttribute>
    Public Shared Function ToAsyncEnumerable (
    	asyncIterable As Object
    ) As IAsyncEnumerable(Of Object)

    public:
    [ExtensionAttribute]
    static IAsyncEnumerable<Object^>^ ToAsyncEnumerable(
    	Object^ asyncIterable
    )

    [<ExtensionAttribute>]
    static member ToAsyncEnumerable :
            asyncIterable : Object -> IAsyncEnumerable<Object>

#### Parameters

asyncIterable Object
  An async-iterable script object (see remarks).

#### Return Value

IAsyncEnumerable Object
An IAsyncEnumerator<Object> implementation that supports managed asynchronous iteration over asyncIterable.

#### 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 implements IAsyncEnumerator<Object>, this method returns it as is.
See Also

#### Reference

JavaScriptExtensions Class
Microsoft.ClearScript.JavaScript Namespace

Copyright © Microsoft Corporation. All rights reserved.

Send comments on this topic to Microsoft