UNPKG

886 BTypeScriptView Raw
1import { ApolloCache } from '../../core';
2export interface ReactiveVar<T> {
3 (newValue?: T): T;
4 onNextChange(listener: ReactiveListener<T>): () => void;
5 attachCache(cache: ApolloCache<any>): this;
6 forgetCache(cache: ApolloCache<any>): boolean;
7}
8export type ReactiveListener<T> = (value: T) => any;
9export declare const cacheSlot: {
10 readonly id: string;
11 hasValue(): boolean;
12 getValue(): ApolloCache<any> | undefined;
13 withValue<TResult, TArgs extends any[], TThis = any>(value: ApolloCache<any>, callback: (this: TThis, ...args: TArgs) => TResult, args?: TArgs | undefined, thisArg?: TThis | undefined): TResult;
14};
15export declare function forgetCache(cache: ApolloCache<any>): void;
16export declare function recallCache(cache: ApolloCache<any>): void;
17export declare function makeVar<T>(value: T): ReactiveVar<T>;
18//# sourceMappingURL=reactiveVars.d.ts.map
\No newline at end of file