A
A
Arthur2020-05-26 12:23:14
React
Arthur, 2020-05-26 12:23:14

Where to modify redux data?

Hello.

Tell me where is the best place to modify the data received by the editor?
For example, the application received a response to a request, we put it in redax (There is some kind of array).

In several parts of the application, we needed this data, but slightly modified.

Is it correct to write a selector that returns the changed data from the store?

Or is it better to return raw data in the selector, and take out the modification separately in some helper and make the modification on the result of the selection data in the component?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
abberati, 2020-05-26
@cloudz

The selector is the right place. If the modification is resource-intensive, then the selector can be memoized

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question