MCPcopy Create free account
hub / github.com/TanStack/query / difference

Function difference

packages/query-core/src/queriesObserver.ts:18–21  ·  view source on GitHub ↗

* 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>)

Source from the content-addressed store, hash-verified

16 * @returns A new array with the items of `array1` that are not in `array2`.
17 */
18function 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
23type QueriesObserverListener = (result: Array<QueryObserverResult>) => void
24

Callers 1

setQueriesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected