@data-client/normalizr
Version:
Normalizes and denormalizes JSON according to schema for Redux and Flux applications
25 lines • 1.1 kB
TypeScript
import type { GetEntityCache } from './entitiesCache.js';
import { EndpointsCache } from './types.js';
import type Cache from '../denormalize/cache.js';
import type { INVALID } from '../denormalize/symbol.js';
import type { EntityInterface, EntityPath } from '../interface.js';
import type { DenormGetEntity } from './types.js';
export default class GlobalCache implements Cache {
private dependencies;
private cycleCache;
private cycleIndex;
private localCache;
private _getCache;
private _getEntity;
private _resultCache;
constructor(getEntity: DenormGetEntity, getCache: GetEntityCache, resultCache: EndpointsCache);
getEntity(pk: string, schema: EntityInterface, entity: any, computeValue: (localCacheKey: Map<string, any>) => void): object | undefined | typeof INVALID;
private getCacheKey;
/** Cache varies based on input (=== aka reference) */
getResults(input: any, cachable: boolean, computeValue: () => any): {
data: any;
paths: EntityPath[];
};
protected paths(): EntityPath[];
}
//# sourceMappingURL=globalCache.d.ts.map