On this page

    M

    util.transferableAbortSignal

    History
    util.transferableAbortSignal(signal): AbortSignal
    Attributes
    Returns:AbortSignal

    Marks the given AbortSignal as transferable so that it can be used with structuredClone() and postMessage().

    const signal = transferableAbortSignal(AbortSignal.timeout(100));
    const channel = new MessageChannel();
    channel.port2.postMessage(signal, [signal]);