以下代码是否会改变history
?如果它确实如何避免它。
const index = findIndex(propEq('editorId', editorId))(editorWrappers);
if (index !== -1) {
const editorHistory = editorWrappers[index].history || [];
const history = filter(item => item.resource !== resource || (item.resource === resource && item.name !== name), editorHistory);
console.log('history', history);
editorWrappers[index].history = history;
}
return [...editorWrappers];
};