1 comment

[ 1.4 ms ] story [ 14.4 ms ] thread
RTK Query is a powerful and easy-to-use server data caching solution built specifically for Redux Toolkit. It's UI-agnostic, and can generate React hooks as well.

RTK Query takes inspiration from many other great libraries like React Query, Apollo, Urql, and SWR, but has unique features and API design:

- Built on RTK and UI-agnostic

- "Cache lifecycle" enables streaming updates via websockets

- Written in TS

- OpenAPI/GraphQL code-gen

RTKQ can completely eliminate all the hand-written data fetching logic in your Redux apps - no more writing thunks, sagas, or loading state for API reqs!

RTK Query also integrates with the rest of the Redux ecosystem, including the Redux DevTools, middleware, and reducers.

RTK Query is included in the Redux Toolkit package as an optional pair of entry points for generic and React-specific logic. There's a one-time bundle cost - if you're using RTK already, it's about 9-11K min+gz.

RTKQ quickly pays for itself by shrinking your app code size!

RTKQ's development has been an amazing collaboration, and I'd like to highlight folks:

- Lenz Weber : primary RTQK impl

- Matt Sutkowski : examples and docs

- GH user Shrugsy: tons of usage docs

- Me: build integration, docs, advertising

- GH user hardfist : ESBuild packaging

I'd also like to thank:

- Tanner Linsley and Dominik Dorfmeister of React-Query for pushing the "server caching is not state mgmt" idea and providing friendly competition

- Brandon Roberts and Saul Moro for demoing NgRx + RTKQ integration

- All our alpha testers for feedback!

We have been _very_ encouraged by the highly positive feedback during the RTQK preview phase, and we think the Redux ecosystem is going to love having RTKQ available as a potential solution.

Please try out RTK Query and see how it can help improve _your_ apps today!