Files
VRCT/src-ui/utils/updateLabelsById.js

6 lines
255 B
JavaScript

export const updateLabelsById = (data_array, updates) => {
return data_array.map(item => {
const update = updates.find(update_item => update_item.id === item.id);
return update ? { ...item, label: update.label } : item;
});
};