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

Artists

PreviousTracksNextCollection

Last updated 2 years ago

useAllArtistsQuery(params?: , queryOptions?: ): {artists: [], ...}

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

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

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

useArtistQuery(idOrSlug: string, queryOptions?: ): {artist: | null, tracks: [], ...}

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

IApiListQueryParams
UseQueryOptions
IArtist
UseQueryResult
IApiListQueryParams
UseInfiniteQueryOptions
IArtist
UseInfiniteQueryResult
UseQueryOptions
IArtist
ITrack
UseQueryResult