recoil
Version:
Recoil - A state management library for React
31 lines (25 loc) • 1 kB
Flow
/**
* (c) Facebook, Inc. and its affiliates. Confidential and proprietary.
*
* @emails oncall+recoil
* @flow strict-local
* @format
*/
;
import type { CachePolicy, EqualityPolicy, EvictionPolicy } from './Recoil_CachePolicy';
import type { TreeCacheImplementation } from './Recoil_TreeCacheImplementationType';
const nullthrows = require('../util/Recoil_nullthrows');
const stableStringify = require('../util/Recoil_stableStringify');
const {
TreeCache
} = require('./Recoil_TreeCache');
const treeCacheLRU = require('./Recoil_treeCacheLRU');
const defaultPolicy = {
equality: 'reference',
eviction: 'none',
maxSize: Infinity
};
declare function treeCacheFromPolicy<T>(arg0: CachePolicy): TreeCacheImplementation<T>;
declare function getValueMapper(equality: EqualityPolicy): (mixed) => mixed;
declare function getTreeCache<T>(eviction: EvictionPolicy, maxSize: ?number, mapNodeValue: (mixed) => mixed): TreeCacheImplementation<T>;
module.exports = treeCacheFromPolicy;