Skip to content

Commit

Permalink
Rename Canon class to ObjectCanon.
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamn committed Dec 16, 2020
1 parent cad1a06 commit 9c6a09c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Expand Up @@ -23,7 +23,7 @@ class Pass<T> {
// which usually means the objects are structurally equivalent (deeply
// equal), but don't necessarily use the same memory.
//
// Like a literary or musical canon, this Canon class represents a
// Like a literary or musical canon, this ObjectCanon class represents a
// collection of unique canonical items (JavaScript objects), with the
// important property that canon.admit(a) === canon.admit(b) if a and b
// are deeply equal to each other. In terms of the definition above, the
Expand Down Expand Up @@ -61,8 +61,8 @@ class Pass<T> {
// In the future, we may consider adding additional cases to the switch
// statement to handle other common object types, such as "[object Date]"
// objects, as needed.
export class Canon {
// Set of all canonical objects this Canon has admitted, allowing
export class ObjectCanon {
// Set of all canonical objects this ObjectCanon has admitted, allowing
// canon.admit to return previously-canonicalized objects immediately.
private known = new (canUseWeakMap ? WeakSet : Set)<object>();

Expand Down
4 changes: 2 additions & 2 deletions src/cache/inmemory/readFromStore.ts
Expand Up @@ -35,7 +35,7 @@ import { getTypenameFromStoreObject } from './helpers';
import { Policies } from './policies';
import { InMemoryCache } from './inMemoryCache';
import { MissingFieldError } from '../core/types/common';
import { Canon } from './canon';
import { ObjectCanon } from './object-canon';

export type VariableMap = { [name: string]: any };

Expand Down Expand Up @@ -326,7 +326,7 @@ export class StoreReader {
return finalResult;
}

private canon = new Canon;
private canon = new ObjectCanon;

private knownResults = new WeakMap<Record<string, any>, SelectionSetNode>();

Expand Down

0 comments on commit 9c6a09c

Please sign in to comment.