@ nfrx / entity适配器是否具有这种功能? 假设我有2个实体:用户和帖子:
users = {
'id1': {
id: id1,
name: user1,
posts: [1, 2, 3]
}
}
posts = {
1: {
id: 1,
userId: id1
},
2: {
id: 2,
userId: id1
},
3: {
id: 3,
userId: id1
}
}
当我删除帖子时:
adaptor.removeOne(action.payload.id, state)
但是此行仅从帖子中删除实体,但已删除帖子的ID保留在user.posts数组中
是否可以根据帖子实体的操作来更新user.post?有一个动作吗?
现在我有两个动作: