Learn Vue JS course Learn Javascript and Vue JS Learn VueJS course Learn VueJS Tutorial

The Complete Guide to Data Fetching in Nuxt

To Await or Not Await useFetch (Blocking vs Non-Blocking) thumbnail image

Get access to the most comprehensive Vue.js video library in the world. Over 300 video lessons including the newest Vue 3 features.

To Await or Not Await useFetch (Blocking vs Non-Blocking)

A common question I’ve heard about Nuxt’s useFetch and useAsyncAwait is: should I always await the result? The answer is: it depends! Awaiting the request will result in blocking navigation unless you explicitly provide the lazy option or use the lazy version of the composable. If you omit the await you’ll be non-blocking navigation without the lazy option.

Links