export const diffArrayChange = <T extends Array<any>>(
  newItems: T,
  oldItems: T
) => {
  const addedItems = [] as unknown as T
  const deletedItems = [] as unknown as T

  for (const item of newItems) {
    if (!oldItems.includes(item)) {
      addedItems.push(item)
    }
  }

  for (const item of oldItems) {
    if (!newItems.includes(item)) {
      deletedItems.push(item)
    }
  }

  return {
    added: addedItems,
    deleted: deletedItems
  }
}
