import { query, redirect } from "@solidjs/router"
const queryThatThrows = query(async () => {
"use server"
const condition = true
if (condition) {
throw redirect("/foo")
}
return true
}, "query-that-throws")
const otherQuery = query(async () => {
"use server"
const v = await queryThatThrows()
type V = typeof v // boolean
// this still runs because the throw gets caught
console.log(v) // undefined
}, "other-query")
import { query, redirect } from "@solidjs/router"
const queryThatThrows = query(async () => {
"use server"
const condition = true
if (condition) {
throw redirect("/foo")
}
return true
}, "query-that-throws")
const otherQuery = query(async () => {
"use server"
const v = await queryThatThrows()
type V = typeof v // boolean
// this still runs because the throw gets caught
console.log(v) // undefined
}, "other-query")