遇到问题。是否有人将gRPC web客户端与Redux Toolkit RTK查询集成在一起?
您可以使用库,这些库为您提供必须使用queryFn
而不是query
调用的api函数。
...
myQuery: builder.query({
async queryFn(arg){
try {
const result = await myApi.someFunction()
return { data: result }
} catch (e) {
return { error: e }
}
}
})