Skip to content

zigar.function.PromiseArgOf(function) ᴾᴴᴾ

Chung Leong edited this page Jul 18, 2026 · 2 revisions

JavaScript | PHP


Return the first promise type in the argument list of function.

Example:

const std = @import("std");
const zigar = @import("zigar");

fn world(promise: zigar.function.Promise(bool)) void {
    promise.resolve(true);
}

comptime {
    std.debug.assert(zigar.function.PromiseArgOf(world) == zigar.function.Promise(bool));
}

Arguments:

  • function: anytype
    A function or a function type.

Return value:

  • Promise(T)

Promise(T) | PromiseArgOf(function)

Clone this wiki locally