fix: fixed the selection and delete widget
This commit is contained in:
14
src/utils/common.js
Normal file
14
src/utils/common.js
Normal file
@@ -0,0 +1,14 @@
|
||||
// contains commonly used functions to manipulate objects, array etc.
|
||||
|
||||
|
||||
export function removeDuplicateObjects(array, key) {
|
||||
const seen = new Set()
|
||||
|
||||
return array.filter(item => {
|
||||
if (!seen.has(item[key])) {
|
||||
seen.add(item[key])
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user