D
D
dblearn942020-04-30 21:31:25
React
dblearn94, 2020-04-30 21:31:25

How to separate reducers and state in redux?

Good evening, plunging into redax got confused.

I can’t understand when it’s worth separating the reducer and state if I have 1 entity, but different data, for example:

The Article entity, there may be 1 article, or there may be a whole list, respectively, the data in the state is different:

articles: [], // для списка статей
article: {} // для одной статьи


It turns out that the reducer will be 2, for the List of Articles and for One Article?

Isn't it redundant?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2020-04-30
@dblearn94

Is it forbidden to implement an array of objects and walk through it in the country?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question