"use server"
type HackyType=Promise<Result<"yay", "nay">>
export async function dbCallHacky(): HackyType{
....
//this fn returns a result async but it's return type has to be promise
return ResultAsync(...)
}
/* linter error:
The "use server" file can only export async functions. Add "async" to the function declaration or return a Promise.
*/
export async function dbCallIdeal():ResultAsync<"yay","nay">{
....
return ResultAsync (...)
}
"use server"
type HackyType=Promise<Result<"yay", "nay">>
export async function dbCallHacky(): HackyType{
....
//this fn returns a result async but it's return type has to be promise
return ResultAsync(...)
}
/* linter error:
The "use server" file can only export async functions. Add "async" to the function declaration or return a Promise.
*/
export async function dbCallIdeal():ResultAsync<"yay","nay">{
....
return ResultAsync (...)
}