Answer the question
In order to leave comments, you need to log in
Redux: where to add extra. data?
The list of groups is stored in state
class group {
constructor(id, name, messagesCount) {
this.id = id;
this.name = name;
this.messagesCount = messagesCount;
}
}
groups: [group1, group2, group3]
{
id1: messages,
id2: messages,
id3:messages
}
Answer the question
In order to leave comments, you need to log in
I try to store all data in a tree (where relationships between entities are strictly vertical) to avoid link invalidation. I vote for group.messages
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question