isAsyncGeneratorFunction
Checks if a value is an async generator function (an async function* declaration or expression).
Distinct from isAsyncGenerator: this predicate targets the function itself, not the async iterator it produces when called.
Available since v2.0.3
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | unknown | The value to check |
Returns
Section titled “Returns”value is AsyncGeneratorFunction — true if value is an AsyncGeneratorFunction
Examples
Section titled “Examples”Detect an async generator function
Section titled “Detect an async generator function”Returns true for async function* declarations and expressions.
Distinguish async generator functions from sync generator functions
Section titled “Distinguish async generator functions from sync generator functions”isAsyncGeneratorFunction is false for sync function*.
