Lift an error value into a ResultAsync.
const guard = (userId: string) => userId ? loadUser(userId) : err({ code: "MISSING_ID" }) Copy
const guard = (userId: string) => userId ? loadUser(userId) : err({ code: "MISSING_ID" })
Lift an error value into a ResultAsync.