Skip to content
Client
Server

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

Function: walkOf() ​

ts
function walkOf<T>(
   fn, 
   options, 
   set?, 
   also?
): tRequestInit<T> & tWalkOptions;

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

As initOf, for a function that walks pages: what it gives also holds maxPages, the most pages the walk may ask for, when the caller gave one. It is what paginate takes, and request has no use for it.

Type Parameters ​

T ​

T

Parameters ​

fn ​

string

The name of the function the options were handed to, for the errors.

options ​

| tReadOptions<T> & tWalkOptions | undefined

What the caller gave, or undefined for nothing.

set? ​

tParams = {}

The parameters the function itself sends, which win over every option.

also? ​

tAlsoKinds = {}

The further options the function takes, by name, with what each is.

Returns ​

tRequestInit<T> & tWalkOptions

What paginate takes: what initOf gives, with maxPages when the caller gave one.

Throws ​

TypeError if initOf would throw it, or maxPages is given and is not a whole number above 0.

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