UNPKG

recoil

Version:

Recoil - A state management library for React

36 lines (29 loc) 1.16 kB
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @emails oncall+recoil * @flow strict-local * @format */ 'use strict'; import type { CachePolicy, EqualityPolicy, EvictionPolicy } from './Recoil_CachePolicy'; import type { TreeCacheImplementation } from './Recoil_TreeCacheImplementationType'; const err = require('../util/Recoil_err'); 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: 'keep-all', 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;