Replies: 1 comment 1 reply
-
If I understood your request correctly, here's the solution. You can just pass the return type of the action to the type FetchResult = {
response: object
}
export const testAction = ac.schema(z.object({
username: z.string(),
// pass generic return type here
})).action<FetchResult>(async () => {
return {
response: {
yourData: "here"
}
}
}); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Helloo 🖐,
i would like to use your lib with generic types. In my app, i have many datatables with button onCopy on each rows and i would like to create a server action where i pass the genereric return type in the function
Like this:
copy.ts
page.tsx
I don't know if it yet possible, tell me 😇
Have a good day !
Beta Was this translation helpful? Give feedback.
All reactions