Skip to content
Client
Server

Reference / @open-music-sdk/react / useMusicQueries

Function: useMusicQueries() ​

ts
function useMusicQueries(): tMusicQueries;

Defined in: integrations/react/src/client.ts:124

musicQueries over the provider's client, in the provider's scope, made once per client and per sign-in. The scope is 0 for the client first handed to the provider, before any sign-in, so a server render and a hydration agree. Each sign-in, and each other client handed to the provider, has a scope of its own, unique across pages, reloads and providers, so what one listener cached, persisted or not, is never under another's keys.

Returns ​

tMusicQueries

The catalog's and the listener's read functions, each as its query.

Throws ​

TypeError if there is no MusicProvider above the component.

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