/** * 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 { RecoilValue } from '../core/Recoil_RecoilValue'; const { useStoreRef } = require('../core/Recoil_RecoilRoot'); const { SUSPENSE_TIMEOUT_MS } = require('../core/Recoil_Retention'); const { updateRetainCount } = require('../core/Recoil_Retention'); const { RetentionZone } = require('../core/Recoil_RetentionZone'); const { useEffect, useRef } = require('react'); const { isSSR } = require('recoil-shared/util/Recoil_Environment'); const gkx = require('recoil-shared/util/Recoil_gkx'); const shallowArrayEqual = require('recoil-shared/util/Recoil_shallowArrayEqual'); const usePrevious = require('recoil-shared/util/Recoil_usePrevious'); // I don't see a way to avoid the any type here because we want to accept readable // and writable values with any type parameter, but normally with writable ones // RecoilState is not a subtype of RecoilState. type ToRetain = RecoilValue // flowlint-line unclear-type:off | RetentionZone | $ReadOnlyArray | RetentionZone>; // flowlint-line unclear-type:off declare function useRetain(toRetain: ToRetain): void; declare function useRetain_ACTUAL(toRetain: ToRetain): void; module.exports = useRetain;