sanity icon indicating copy to clipboard operation
sanity copied to clipboard

Listen for 'loading' events in sanity fetch both globally and locally

Open toddpadwick opened this issue 3 years ago • 0 comments

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 loading of a single sanity fetch query, and display a loading icon in the same component accordingly.
  • Listen for loading of 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?

toddpadwick avatar Oct 12 '22 13:10 toddpadwick