spinamp-hooks
  • About
  • Installation
  • Basic usage
  • Reference
    • Hooks reference
      • Tracks
      • Artists
      • Collection
      • NFTs
      • Platforms
      • Playlists
  • spinamp-sdk inheritance
  • Advanced usage
Powered by GitBook
On this page
  1. Reference
  2. Hooks reference

Tracks

PreviousHooks referenceNextArtists

Last updated 2 years ago

useAllTracksQuery(params?: , queryOptions?: ): {tracks: [], ...}

Used for querying list of all tracks. If no params are provided, it will return list of all tracks existing in the database, which will result in huge request. For pagination/infinite scroll queries, usePaginatedTracksQuery is recommended.

usePaginatedTracksQuery(pageSize? = 20, params?: Pick<, 'filter' | 'orderBy'>, queryOptions?: ): {tracks: [], totalCount: number | null, ...}

Used for querying list of all tracks in chunks, e.g. for infinity lists. Returns flat tracks array with all fetched items, totalCount and all UseInfiniteQueryResult properties, including fetchNextPage and hasNextPage properties for pagination.

useTrackQuery(idOrSlug: string, queryOptions?: ): {track: | null, ...}

Used for querying details of specific track based on provided id or slug.

IApiListQueryParams
UseQueryOptions
ITrack
UseQueryResult
IApiListQueryParams
UseInfiniteQueryOptions
ITrack
UseInfiniteQueryResult
UseQueryOptions
ITrack
UseQueryResult