Amir Fahmideh
Amir Fahmideh

Reputation: 465

Usage of React Toolkit And RTK Query for api

I built an enterprise application with Redux Toolkit and use RTK Query for all of API endpoint as slice, Is ok that all data store in redux store? It seems to have unnecessary data to store in redux store object because I always request them from server in page load or just use them in single views

Upvotes: 0

Views: 387

Answers (1)

phry
phry

Reputation: 44078

Redux is an in-memory store, so the part of "always requesting them from the server" is totally okay - and we even recommend against persisting that data on the client.

If your app actually has the complexity to need it is something only you can answer. But generally, I would always use some tool for that purpose and RTK Query is not significantly bigger or smaller than similar tools, so you are probably fine.

Upvotes: 1

Related Questions