Mock connect-es services for RTK Query in Storybook #868
boan-anbo
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I feel this is a common stack for React apps so I'm sharing my current implementation for mocking services generated by
connect-es
here for those who need it.This showcases both how to use RTQ Query with connect-es grpc-web clients and how to mock both in Storybook environment.
The connect-es generated clients will then be wrapped in RTK Query as custom queryFn like so:
Beta Was this translation helpful? Give feedback.
All reactions