* Returns the items of `array1` that are not in `array2`. * @param array1 - The items to filter. * @param array2 - The items to exclude. * @returns A new array with the items of `array1` that are not in `array2`.
(array1: Array<T>, array2: Array<T>)
| 16 | * @returns A new array with the items of `array1` that are not in `array2`. |
| 17 | */ |
| 18 | function difference<T>(array1: Array<T>, array2: Array<T>): Array<T> { |
| 19 | const excludeSet = new Set(array2) |
| 20 | return array1.filter((x) => !excludeSet.has(x)) |
| 21 | } |
| 22 | |
| 23 | type QueriesObserverListener = (result: Array<QueryObserverResult>) => void |
| 24 |