the-forest/client/node_modules/.cache/babel-loader/ff7d0c71e1a7839c3c90edbc33d1da567c97caf7d33b56361554d3bd2593469b.json
2024-09-17 20:35:18 -04:00

1 line
20 KiB
JSON

{"ast":null,"code":"// src/queriesObserver.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { QueryObserver } from \"./queryObserver.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { replaceEqualDeep } from \"./utils.js\";\nfunction difference(array1, array2) {\n return array1.filter(x => !array2.includes(x));\n}\nfunction replaceAt(array, index, value) {\n const copy = array.slice(0);\n copy[index] = value;\n return copy;\n}\nvar QueriesObserver = class extends Subscribable {\n #client;\n #result;\n #queries;\n #observers;\n #combinedResult;\n #lastCombine;\n #lastResult;\n constructor(client, queries, _options) {\n super();\n this.#client = client;\n this.#queries = [];\n this.#observers = [];\n this.#result = [];\n this.setQueries(queries);\n }\n onSubscribe() {\n if (this.listeners.size === 1) {\n this.#observers.forEach(observer => {\n observer.subscribe(result => {\n this.#onUpdate(observer, result);\n });\n });\n }\n }\n onUnsubscribe() {\n if (!this.listeners.size) {\n this.destroy();\n }\n }\n destroy() {\n this.listeners = /* @__PURE__ */new Set();\n this.#observers.forEach(observer => {\n observer.destroy();\n });\n }\n setQueries(queries, _options, notifyOptions) {\n this.#queries = queries;\n notifyManager.batch(() => {\n const prevObservers = this.#observers;\n const newObserverMatches = this.#findMatchingObservers(this.#queries);\n newObserverMatches.forEach(match => match.observer.setOptions(match.defaultedQueryOptions, notifyOptions));\n const newObservers = newObserverMatches.map(match => match.observer);\n const newResult = newObservers.map(observer => observer.getCurrentResult());\n const hasIndexChange = newObservers.some((observer, index) => observer !== prevObservers[index]);\n if (prevObservers.length === newObservers.length && !hasIndexChange) {\n return;\n }\n this.#observers = newObservers;\n this.#result = newResult;\n if (!this.hasListeners()) {\n return;\n }\n difference(prevObservers, newObservers).forEach(observer => {\n observer.destroy();\n });\n difference(newObservers, prevObservers).forEach(observer => {\n observer.subscribe(result => {\n this.#onUpdate(observer, result);\n });\n });\n this.#notify();\n });\n }\n getCurrentResult() {\n return this.#result;\n }\n getQueries() {\n return this.#observers.map(observer => observer.getCurrentQuery());\n }\n getObservers() {\n return this.#observers;\n }\n getOptimisticResult(queries, combine) {\n const matches = this.#findMatchingObservers(queries);\n const result = matches.map(match => match.observer.getOptimisticResult(match.defaultedQueryOptions));\n return [result, r => {\n return this.#combineResult(r ?? result, combine);\n }, () => {\n return matches.map((match, index) => {\n const observerResult = result[index];\n return !match.defaultedQueryOptions.notifyOnChangeProps ? match.observer.trackResult(observerResult, accessedProp => {\n matches.forEach(m => {\n m.observer.trackProp(accessedProp);\n });\n }) : observerResult;\n });\n }];\n }\n #combineResult(input, combine) {\n if (combine) {\n if (!this.#combinedResult || this.#result !== this.#lastResult || combine !== this.#lastCombine) {\n this.#lastCombine = combine;\n this.#lastResult = this.#result;\n this.#combinedResult = replaceEqualDeep(this.#combinedResult, combine(input));\n }\n return this.#combinedResult;\n }\n return input;\n }\n #findMatchingObservers(queries) {\n const prevObservers = this.#observers;\n const prevObserversMap = new Map(prevObservers.map(observer => [observer.options.queryHash, observer]));\n const defaultedQueryOptions = queries.map(options => this.#client.defaultQueryOptions(options));\n const matchingObservers = defaultedQueryOptions.flatMap(defaultedOptions => {\n const match = prevObserversMap.get(defaultedOptions.queryHash);\n if (match != null) {\n return [{\n defaultedQueryOptions: defaultedOptions,\n observer: match\n }];\n }\n return [];\n });\n const matchedQueryHashes = new Set(matchingObservers.map(match => match.defaultedQueryOptions.queryHash));\n const unmatchedQueries = defaultedQueryOptions.filter(defaultedOptions => !matchedQueryHashes.has(defaultedOptions.queryHash));\n const getObserver = options => {\n const defaultedOptions = this.#client.defaultQueryOptions(options);\n const currentObserver = this.#observers.find(o => o.options.queryHash === defaultedOptions.queryHash);\n return currentObserver ?? new QueryObserver(this.#client, defaultedOptions);\n };\n const newOrReusedObservers = unmatchedQueries.map(options => {\n return {\n defaultedQueryOptions: options,\n observer: getObserver(options)\n };\n });\n const sortMatchesByOrderOfQueries = (a, b) => defaultedQueryOptions.indexOf(a.defaultedQueryOptions) - defaultedQueryOptions.indexOf(b.defaultedQueryOptions);\n return matchingObservers.concat(newOrReusedObservers).sort(sortMatchesByOrderOfQueries);\n }\n #onUpdate(observer, result) {\n const index = this.#observers.indexOf(observer);\n if (index !== -1) {\n this.#result = replaceAt(this.#result, index, result);\n this.#notify();\n }\n }\n #notify() {\n notifyManager.batch(() => {\n this.listeners.forEach(listener => {\n listener(this.#result);\n });\n });\n }\n};\nexport { QueriesObserver };","map":{"version":3,"names":["notifyManager","QueryObserver","Subscribable","replaceEqualDeep","difference","array1","array2","filter","x","includes","replaceAt","array","index","value","copy","slice","QueriesObserver","client","result","queries","observers","combinedResult","lastCombine","lastResult","constructor","_options","setQueries","onSubscribe","listeners","size","forEach","observer","subscribe","onUpdate","onUnsubscribe","destroy","Set","notifyOptions","batch","prevObservers","newObserverMatches","findMatchingObservers","match","setOptions","defaultedQueryOptions","newObservers","map","newResult","getCurrentResult","hasIndexChange","some","length","hasListeners","notify","getQueries","getCurrentQuery","getObservers","getOptimisticResult","combine","matches","r","combineResult","observerResult","notifyOnChangeProps","trackResult","accessedProp","m","trackProp","#combineResult","input","#findMatchingObservers","prevObserversMap","Map","options","queryHash","defaultQueryOptions","matchingObservers","flatMap","defaultedOptions","get","matchedQueryHashes","unmatchedQueries","has","getObserver","currentObserver","find","o","newOrReusedObservers","sortMatchesByOrderOfQueries","a","b","indexOf","concat","sort","#onUpdate","#notify","listener"],"sources":["/Users/shoofle/Projects/the-forest/client/node_modules/@tanstack/query-core/src/queriesObserver.ts"],"sourcesContent":["import { notifyManager } from './notifyManager'\nimport { QueryObserver } from './queryObserver'\nimport { Subscribable } from './subscribable'\nimport { replaceEqualDeep } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n QueryObserverOptions,\n QueryObserverResult,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { NotifyOptions } from './queryObserver'\n\nfunction difference<T>(array1: Array<T>, array2: Array<T>): Array<T> {\n return array1.filter((x) => !array2.includes(x))\n}\n\nfunction replaceAt<T>(array: Array<T>, index: number, value: T): Array<T> {\n const copy = array.slice(0)\n copy[index] = value\n return copy\n}\n\ntype QueriesObserverListener = (result: Array<QueryObserverResult>) => void\n\ntype CombineFn<TCombinedResult> = (\n result: Array<QueryObserverResult>,\n) => TCombinedResult\n\nexport interface QueriesObserverOptions<\n TCombinedResult = Array<QueryObserverResult>,\n> {\n combine?: CombineFn<TCombinedResult>\n}\n\nexport class QueriesObserver<\n TCombinedResult = Array<QueryObserverResult>,\n> extends Subscribable<QueriesObserverListener> {\n #client: QueryClient\n #result!: Array<QueryObserverResult>\n #queries: Array<QueryObserverOptions>\n #observers: Array<QueryObserver>\n #combinedResult?: TCombinedResult\n #lastCombine?: CombineFn<TCombinedResult>\n #lastResult?: Array<QueryObserverResult>\n\n constructor(\n client: QueryClient,\n queries: Array<QueryObserverOptions<any, any, any, any, any>>,\n _options?: QueriesObserverOptions<TCombinedResult>,\n ) {\n super()\n\n this.#client = client\n this.#queries = []\n this.#observers = []\n this.#result = []\n\n this.setQueries(queries)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#observers.forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.listeners.size) {\n this.destroy()\n }\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#observers.forEach((observer) => {\n observer.destroy()\n })\n }\n\n setQueries(\n queries: Array<QueryObserverOptions>,\n _options?: QueriesObserverOptions<TCombinedResult>,\n notifyOptions?: NotifyOptions,\n ): void {\n this.#queries = queries\n\n notifyManager.batch(() => {\n const prevObservers = this.#observers\n\n const newObserverMatches = this.#findMatchingObservers(this.#queries)\n\n // set options for the new observers to notify of changes\n newObserverMatches.forEach((match) =>\n match.observer.setOptions(match.defaultedQueryOptions, notifyOptions),\n )\n\n const newObservers = newObserverMatches.map((match) => match.observer)\n const newResult = newObservers.map((observer) =>\n observer.getCurrentResult(),\n )\n\n const hasIndexChange = newObservers.some(\n (observer, index) => observer !== prevObservers[index],\n )\n\n if (prevObservers.length === newObservers.length && !hasIndexChange) {\n return\n }\n\n this.#observers = newObservers\n this.#result = newResult\n\n if (!this.hasListeners()) {\n return\n }\n\n difference(prevObservers, newObservers).forEach((observer) => {\n observer.destroy()\n })\n\n difference(newObservers, prevObservers).forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n\n this.#notify()\n })\n }\n\n getCurrentResult(): Array<QueryObserverResult> {\n return this.#result\n }\n\n getQueries() {\n return this.#observers.map((observer) => observer.getCurrentQuery())\n }\n\n getObservers() {\n return this.#observers\n }\n\n getOptimisticResult(\n queries: Array<QueryObserverOptions>,\n combine: CombineFn<TCombinedResult> | undefined,\n ): [\n rawResult: Array<QueryObserverResult>,\n combineResult: (r?: Array<QueryObserverResult>) => TCombinedResult,\n trackResult: () => Array<QueryObserverResult>,\n ] {\n const matches = this.#findMatchingObservers(queries)\n const result = matches.map((match) =>\n match.observer.getOptimisticResult(match.defaultedQueryOptions),\n )\n\n return [\n result,\n (r?: Array<QueryObserverResult>) => {\n return this.#combineResult(r ?? result, combine)\n },\n () => {\n return matches.map((match, index) => {\n const observerResult = result[index]!\n return !match.defaultedQueryOptions.notifyOnChangeProps\n ? match.observer.trackResult(observerResult, (accessedProp) => {\n // track property on all observers to ensure proper (synchronized) tracking (#7000)\n matches.forEach((m) => {\n m.observer.trackProp(accessedProp)\n })\n })\n : observerResult\n })\n },\n ]\n }\n\n #combineResult(\n input: Array<QueryObserverResult>,\n combine: CombineFn<TCombinedResult> | undefined,\n ): TCombinedResult {\n if (combine) {\n if (\n !this.#combinedResult ||\n this.#result !== this.#lastResult ||\n combine !== this.#lastCombine\n ) {\n this.#lastCombine = combine\n this.#lastResult = this.#result\n this.#combinedResult = replaceEqualDeep(\n this.#combinedResult,\n combine(input),\n )\n }\n\n return this.#combinedResult\n }\n return input as any\n }\n\n #findMatchingObservers(\n queries: Array<QueryObserverOptions>,\n ): Array<QueryObserverMatch> {\n const prevObservers = this.#observers\n const prevObserversMap = new Map(\n prevObservers.map((observer) => [observer.options.queryHash, observer]),\n )\n\n const defaultedQueryOptions = queries.map((options) =>\n this.#client.defaultQueryOptions(options),\n )\n\n const matchingObservers: Array<QueryObserverMatch> =\n defaultedQueryOptions.flatMap((defaultedOptions) => {\n const match = prevObserversMap.get(defaultedOptions.queryHash)\n if (match != null) {\n return [{ defaultedQueryOptions: defaultedOptions, observer: match }]\n }\n return []\n })\n\n const matchedQueryHashes = new Set(\n matchingObservers.map((match) => match.defaultedQueryOptions.queryHash),\n )\n const unmatchedQueries = defaultedQueryOptions.filter(\n (defaultedOptions) => !matchedQueryHashes.has(defaultedOptions.queryHash),\n )\n\n const getObserver = (options: QueryObserverOptions): QueryObserver => {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n const currentObserver = this.#observers.find(\n (o) => o.options.queryHash === defaultedOptions.queryHash,\n )\n return (\n currentObserver ?? new QueryObserver(this.#client, defaultedOptions)\n )\n }\n\n const newOrReusedObservers: Array<QueryObserverMatch> =\n unmatchedQueries.map((options) => {\n return {\n defaultedQueryOptions: options,\n observer: getObserver(options),\n }\n })\n\n const sortMatchesByOrderOfQueries = (\n a: QueryObserverMatch,\n b: QueryObserverMatch,\n ): number =>\n defaultedQueryOptions.indexOf(a.defaultedQueryOptions) -\n defaultedQueryOptions.indexOf(b.defaultedQueryOptions)\n\n return matchingObservers\n .concat(newOrReusedObservers)\n .sort(sortMatchesByOrderOfQueries)\n }\n\n #onUpdate(observer: QueryObserver, result: QueryObserverResult): void {\n const index = this.#observers.indexOf(observer)\n if (index !== -1) {\n this.#result = replaceAt(this.#result, index, result)\n this.#notify()\n }\n }\n\n #notify(): void {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(this.#result)\n })\n })\n }\n}\n\ntype QueryObserverMatch = {\n defaultedQueryOptions: DefaultedQuery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