ConsoleTVs / sswr

🔥 Svelte stale while revalidate (SWR) data fetching strategy
MIT License
234 stars 11 forks source link

Global Background Fetching Indicator #15

Open frederikhors opened 3 years ago

frederikhors commented 3 years ago

PROLOGUE

I'm sorry if I'm always mentioning svelte-query these days.

I'll stop shortly (I'm starting a new project and I wanna use your gorgeous sswr).

I hope to be a great tester/helper/improver.

REQUEST

Svelte-Query has a Global Background Fetching Indicator.

I can use it in my __layout.svelte file like this:

<script>
  import { useIsFetching } from "@sveltestack/svelte-query";

  const isFetching = useIsFetching();
</script>

{#if $isFetching}
  <div>Queries are fetching in the background...</div>
{/if}

Can we do the same?

It's really really useful!