Home Reference Source
import GenreStationFetcher from '@kkbox/kkbox-js-sdk/src/api/GenreStationFetcher.js'
public class | source

GenreStationFetcher

Extends:

Fetcher → GenreStationFetcher

Get genre stations.

See:

Method Summary

Public Methods
public

Fetch all genre stations.

public

Fetch metadata of the genre station with the genre station fetcher.

public

setGenreStationID(genreStationID: string): GenreStation

Init the genre station fetcher.

Inherited Summary

From class Fetcher
public

fetchNextPage(fulfillment: fulfillment, nextUriPath: String): Promise

Fetches next page of various paged APIs.

public

hasNextPage(fulfillment: fulfillment, nextUriPath: String): Boolean

Is next page available for various paged APIs.

public

setTerritory(territory: string): Fetcher

Set the fetcher's territory.

Public Methods

public fetchAllGenreStations(limit: number, offset: number): Promise source

Fetch all genre stations. The result will be paged.

Params:

NameTypeAttributeDescription
limit number
  • optional

The size for one page.

offset number
  • optional

The offset index for first element.

Return:

Promise

Example:

api.genreStationFetcher.fetchAllGenreStations();

See:

public fetchMetadata(): Promise source

Fetch metadata of the genre station with the genre station fetcher.

Return:

Promise

Example:

api.genreStationFetcher.setGenreStationID('TYq3EHFTl-1EOvJM5Y').fetchMetadata();

See:

public setGenreStationID(genreStationID: string): GenreStation source

Init the genre station fetcher.

Params:

NameTypeAttributeDescription
genreStationID string

The ID of a genre station.

Return:

GenreStation

See: