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

MoodStationFetcher

Extends:

Fetcher → MoodStationFetcher

Get mood stations.

See:

Member Summary

Public Members
public

Method Summary

Public Methods
public

Fetch all mood stations.

public

Fetch the mood station's metadata.

public

setMoodStationID(moodStationID: string, territory: string): MoodStation

Init the mood 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 Members

public territory: * source

Public Methods

public fetchAllMoodStations(): Promise source

Fetch all mood stations.

Return:

Promise

Example:

api.moodStationFetcher.fetchAllMoodStations();

See:

public fetchMetadata(): Promise source

Fetch the mood station's metadata.

Return:

Promise

Example:

api.moodStationFetcher.setMoodStationID('StGZp2ToWq92diPHS7').fetchMetadata();

See:

public setMoodStationID(moodStationID: string, territory: string): MoodStation source

Init the mood station fetcher.

Params:

NameTypeAttributeDescription
moodStationID string

The ID of a mood station.

territory string
  • optional
  • default: 'TW'

['TW', 'HK', 'SG', 'MY', 'JP'] The territory of a mood station.

Return:

MoodStation

See: