-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redux Toolkit/RTK Query support? #393
Comments
+1 for this feature, it will be great to have an integration with RTK Query. And a good point to adopt ts-rest instead of tRPC. |
I started using And now I am looking for RTK Query integration and stumbled on this. I am going attempt to create a RTK Query wrapper to work with |
@t1mmen Sorry, I've just gotten to this issue, as I've been slowly going through our backlog. I see huge merit in supporting older libraries like Redux/RTK Query, however, my fear is that it would become abandonware since none of the maintainers currently use it AFAIK. Personally, I've not touched a Redux codebase in 6 years, so even before the birth of RTK Query 😅 However, I've cleaned up and refactored out a lot of the common code between the different ts-rest client libraries, so, although I'm leaning away from it, it should be much easier now to introduce a new library. So maybe, if you have someone from @Timely to assist with the maintenance of that specific package, maybe we could make it work (also thank you for sponsoring, I just noticed ❤) I would suggest a gradual migration to something like React Query. Although I haven't thoroughly thought this one out, I believe it should be relatively simple to use React Query's |
We solved our use-case by generating an OpenAPI spec, then generating RTKQ slices from that same spec. It works quite well, so our immediate needs are covered. While I'd happily go react-query for a new project, we're too entangled in Redux for our core product at this stage. https://redux-toolkit.js.org/rtk-query/usage/customizing-create-api seems like the entry point to start building this. We can't commit to pursuing this now, but if we do at some stage, we'll happily contribute back :) Thanks again for an awesome project, you've saved us so. much. time! |
@t1mmen oh that's awesome that that's possible. Great to hear! We're a bit consumed now working on v4 of ts-rest, but for sure we'll evaluate this afterwards. |
This is mostly a question, as I'm not 100% sure it's reasonable to even try.
Situation
I'm building an API on
ts-rest
with one use-case being a NextJS app usingreact-query
. This experience is absolutely amazing, and I am wildly in love with gains in productivity, safety, and documentation. Fantastic work! 👏Upcoming challenge
The
ts-rest
API will be consumed by a pre-existing app that uses Redux Toolkit with RTK Query.The excellent types coming out of
ts-rest
will certainly ease this implementation, but given thatts-rest
has spoiled me rotten for DX and productivity gains, I'm keen to bring all of that into the Redux-based app.I don't yet have hands-on experience with RTK Query, but I think I'm looking for a way to leverage
ts-rest
contracts via RTK'screateApi()
to avoid repetition, likely with a wrapper around thefetchBaseQuery()
.PS: We at @Timely just became sponsors. I'm not opposed to a offering a bounty on this too, btw.
The text was updated successfully, but these errors were encountered: