J
J
JS Noob2020-02-16 01:30:20
React
JS Noob, 2020-02-16 01:30:20

What can and cannot be stored in the redux store?

Is it possible to store an array of react element refs in a store? Is it possible to store a function in the redux store so that it can be retrieved from there and signed or unsubscribed by event listeners?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Klein Maximus, 2020-02-16
@JS_Noob

You can store anything, including refs to elements. But is it necessary?

F
Frimko, 2020-02-17
@Frimko

devtools hasn't been updated for a long time, it's adapted for immutable data. This principle is recommended by the author of the redax himself.

B
bini1988, 2020-02-17
@bini1988

https://redux.js.org/faq/organizing-state#can-i-pu... You
can technically store anything in the redux store, it's still a regular js object. In practice, I would avoid this approach, it will most likely break the devtools and potentially lead to memory leaks.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question