mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 14:27:04 +00:00
Relay runtime: fix Store options (#42152)
Related change in Relay: https://github.com/facebook/relay/commit/6ed264413ba8cdd586d695e5ed234951ee9eca13
This commit is contained in:
Vendored
+1
@@ -5,6 +5,7 @@
|
||||
// Cameron Knight <https://github.com/ckknight>
|
||||
// Renan Machado <https://github.com/renanmav>
|
||||
// Stephen Pittman <https://github.com/Stephen2>
|
||||
// Martin Zlámal <https://github.com/mrtnzlml>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.0
|
||||
|
||||
|
||||
+5
-2
@@ -7,7 +7,6 @@ import {
|
||||
OperationAvailability,
|
||||
OperationDescriptor,
|
||||
RecordSource,
|
||||
NormalizationSelector,
|
||||
ReaderSelector,
|
||||
Snapshot,
|
||||
RequestDescriptor,
|
||||
@@ -22,7 +21,11 @@ import {
|
||||
} from './RelayConnection';
|
||||
|
||||
export class RelayModernStore implements Store {
|
||||
constructor(source: MutableRecordSource, gcScheduler?: Scheduler, operationLoader?: OperationLoader | null);
|
||||
constructor(source: MutableRecordSource, options?: {
|
||||
gcScheduler?: Scheduler | null,
|
||||
operationLoader?: OperationLoader | null,
|
||||
gcReleaseBufferSize?: number | null,
|
||||
});
|
||||
getSource(): RecordSource;
|
||||
check(operation: OperationDescriptor, options?: CheckOptions): OperationAvailability;
|
||||
retain(operation: OperationDescriptor): Disposable;
|
||||
|
||||
@@ -16,6 +16,19 @@ import {
|
||||
|
||||
const source = new RecordSource();
|
||||
const store = new Store(source);
|
||||
const storeWithNullOptions = new Store(source, {
|
||||
gcScheduler: null,
|
||||
operationLoader: null,
|
||||
gcReleaseBufferSize: null,
|
||||
});
|
||||
const storeWithOptions = new Store(source, {
|
||||
gcScheduler: () => undefined,
|
||||
operationLoader: {
|
||||
get: () => null,
|
||||
load: () => Promise.resolve(null),
|
||||
},
|
||||
gcReleaseBufferSize: 10,
|
||||
});
|
||||
|
||||
// ~~~~~~~~~~~~~~~~~~~~~
|
||||
// Network Layer
|
||||
|
||||
Reference in New Issue
Block a user