mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-25 22:37:27 -04:00
f3d7852ec4
Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
16 lines
369 B
JavaScript
16 lines
369 B
JavaScript
function getRemovedItems(prevItems, currentItems, idProp = 'id') {
|
|
if (prevItems === currentItems) {
|
|
return [];
|
|
}
|
|
|
|
const currentItemIds = new Set();
|
|
|
|
currentItems.forEach((currentItem) => {
|
|
currentItemIds.add(currentItem[idProp]);
|
|
});
|
|
|
|
return prevItems.filter((prevItem) => !currentItemIds.has(prevItem[idProp]));
|
|
}
|
|
|
|
export default getRemovedItems;
|