How to set an empty array as a query's initial value without it inferring undefined? #108
-
Considering this example: const todos = ref([]) // initial value is [] so I don't have to check for undefined in the code
async function fetchData(){
todos.value = await apiCall() // <- always returns array
}
fetchData() |
Beta Was this translation helpful? Give feedback.
Answered by
posva
Nov 14, 2024
Replies: 1 comment 7 replies
-
Pass it with |
Beta Was this translation helpful? Give feedback.
7 replies
Answer selected by
franciscohermida
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pass it with
initialData
orplaceholderData