Can I get loading state from data fetch?

Hello, I was wondering if I could grab the loading state of a fetch so I can make some loading ui. I tried

const { data, error, loading } = await supabase .from('posts') .select() if(loading){ console.log("loading") }

But this didn't seem to return loading at all even when it was clear data was loading. I don't see loading anywhere in the docs so not sure if it's doable or not.
Was this page helpful?