sanity
sanity copied to clipboard
Listen for 'loading' events in sanity fetch both globally and locally
hey, Nuxt/Sanity team. I'm new to using this module. Having previously used Nuxt/Apollo which has an out-of-the-box loading listener, I am now unsure how to recreate the same logic to Nuxt/sanity. I would like to achieve the following:
- listen for
loadingof a single sanity fetch query, and display a loading icon in the same component accordingly. - Listen for
loadingof all/any sanity fetch queries occurring in the app, and display a global loading icon in the layout component.
I am using Nuxt 3.0.0-rc.11 and Nuxt/sanity ^1.3.0
Whats the best practice way to handle these features?