Skip to content

Commit

Permalink
Reuse diff/lastDiff terminology, instead of newDiff/oldDiff.
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamn committed Apr 20, 2021
1 parent 6933b6f commit 875a5af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/cache/core/types/Cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { ApolloCache } from '../cache';

export namespace Cache {
export type WatchCallback = (
newDiff: Cache.DiffResult<any>,
oldDiff?: Cache.DiffResult<any>,
diff: Cache.DiffResult<any>,
lastDiff?: Cache.DiffResult<any>,
) => void;

export interface ReadOptions<TVariables = any, TData = any>
Expand Down
4 changes: 2 additions & 2 deletions src/core/QueryManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1137,14 +1137,14 @@ export class QueryManager<TStore> {
// temporary optimistic layer, in case that ever matters.
removeOptimistic,

onWatchUpdated: onQueryUpdated && function (watch, newDiff, oldDiff) {
onWatchUpdated: onQueryUpdated && function (watch, diff, lastDiff) {
const oq =
watch.watcher instanceof QueryInfo &&
watch.watcher.observableQuery;

if (oq) {
includedQueriesById.delete(oq.queryId);
return maybeAddResult(oq, onQueryUpdated(oq, newDiff, oldDiff));
return maybeAddResult(oq, onQueryUpdated(oq, diff, lastDiff));
}
},
});
Expand Down
4 changes: 2 additions & 2 deletions src/core/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export type QueryListener = (queryInfo: QueryInfo) => void;

export type OnQueryUpdated<TData> = (
observableQuery: ObservableQuery,
newDiff: Cache.DiffResult<TData>,
oldDiff?: Cache.DiffResult<TData>,
diff: Cache.DiffResult<TData>,
lastDiff?: Cache.DiffResult<TData>,
) => boolean | Promise<ApolloQueryResult<TData>>;

export type OperationVariables = Record<string, any>;
Expand Down

0 comments on commit 875a5af

Please sign in to comment.