Skip to content

Commit

Permalink
Remove unused RecordSource::load()
Browse files Browse the repository at this point in the history
Summary: Removes the unused `load()` method on RecordSource. The original intent of this was to support having RecordSources that could collect (during GC) records and purge them to disk, and then reload them back into memory if later needed. We haven't ended up doing that so let's remove the method for now.

Reviewed By: kassens

Differential Revision: D17207314

fbshipit-source-id: 754bcb1eccf1596564e5424964c6d5075c7f03ba
  • Loading branch information
josephsavona authored and facebook-github-bot committed Sep 5, 2019
1 parent 4984d28 commit bd15d4e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 deletions.
7 changes: 0 additions & 7 deletions packages/relay-runtime/store/RelayRecordSourceMapImpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,6 @@ class RelayMapRecordSourceMapImpl implements MutableRecordSource {
return this._records.has(dataID);
}

load(
dataID: DataID,
callback: (error: ?Error, record: ?Record) => void,
): void {
callback(null, this.get(dataID));
}

remove(dataID: DataID): void {
this._records.delete(dataID);
}
Expand Down
7 changes: 0 additions & 7 deletions packages/relay-runtime/store/RelayRecordSourceObjectImpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,6 @@ class RelayRecordSourceObjectImpl implements MutableRecordSource {
return this._records.hasOwnProperty(dataID);
}

load(
dataID: DataID,
callback: (error: ?Error, record: ?Record) => void,
): void {
callback(null, this.get(dataID));
}

remove(dataID: DataID): void {
delete this._records[dataID];
}
Expand Down
6 changes: 1 addition & 5 deletions packages/relay-runtime/store/RelayStoreTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,8 @@ export interface RecordSource {
getRecordIDs(): Array<DataID>;
getStatus(dataID: DataID): RecordState;
has(dataID: DataID): boolean;
load(
dataID: DataID,
callback: (error: ?Error, record: ?Record) => void,
): void;
size(): number;
toJSON(): {[DataID]: ?Record};
}

/**
Expand All @@ -205,7 +202,6 @@ export interface MutableRecordSource extends RecordSource {
delete(dataID: DataID): void;
remove(dataID: DataID): void;
set(dataID: DataID, record: Record): void;
toJSON(): {[DataID]: ?Record};
}

/**
Expand Down

0 comments on commit bd15d4e

Please sign in to comment.