PRINCESSELSA
PRINCESSELSA
TtRPC
Created by PRINCESSELSA on 3/5/2025 in #❓-help
How to wrap response type with useAsyncData from Nuxt?
I'm using the vanilla client with Nuxt currently but it's a little tedious calling useAsyncData(() => client.someProcedure.query()) on every call so that I don't double fetch during SSR. Is there a way to make a wrapper client that will wrap query and mutation responses with the useAsyncData() call? I would love if the client was typed and I could call it the same way I can call the vanilla client.
2 replies