Function create_context

  • Requires V8 and async stack traces feature. Credit to @WolverinDEV.

    Returns any

    See

    https://stackoverflow.com/a/75449704/1541397

    Example

    const ctx = create_context();

    console.log(ctx.with("foo", () => {
    return ctx() + ctx();
    })); // "foofoo"

    console.log(await ctx.with("bar", async () => {
    await timeout(1000);
    return ctx() + ctx();
    })); // "barbar"

Generated using TypeDoc