Skip to content
Client
Server

Reference / @open-music-sdk/core / signalOf

Function: signalOf() ​

ts
function signalOf(fn, value): AbortSignal | undefined;

Defined in: packages/core/src/options.ts:113

A signal as fetch will take it, or none. Anything else would be found out late, after other things had been asked for, and by the runtime, whose own complaint prints what it was handed; here it is the caller's mistake, said so. Every package that takes a signal option holds it to this.

Parameters ​

fn ​

string

The name of the function whose option it is, for the error.

value ​

unknown

What was handed over as the signal.

Returns ​

AbortSignal | undefined

The signal, or undefined where none was given.

Throws ​

TypeError if value is neither undefined nor an AbortSignal.

MIT licensed. Not affiliated with, endorsed by, or sponsored by Apple Inc. Apple Music and MusicKit are trademarks of Apple Inc.