Checks if the given value is an AsyncFunction (opens in a new tab).
Syntax
import { isAsyFn } from '@opentf/std';
isAsyFn(
val: unknown
): boolean
Examples
isAsyFn(function() {}) //=> false
isAsyFn({}) //=> false
function* generator(i) {
yield i;
yield i + 10;
}
isAsyFn(generator); //=> false
const afn = async () => {}
isAsyFn(afn) //=> true
async function getUsers() {}
isAsyFn(getUsers) //=> true
async function* aGen(i) {
yield i;
yield i + 10;
}
isAsyFn(aGen); //=> true