UNPKG

recoil

Version:

Recoil - A state management library for React

31 lines (26 loc) 957 B
/** * 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. * * Deep freeze values. Do not descend into React elements, Immutable structures, * or in general things that respond poorly to being frozen. Follows the * implementation of deepFreezeValue. * * @emails oncall+recoil * @flow strict-local * @format */ 'use strict'; const { isReactNative, isSSR } = require('./Recoil_Environment'); const isNode = require('./Recoil_isNode'); const isPromise = require('./Recoil_isPromise'); declare function shouldNotBeFrozen(value: mixed): boolean; // Recursively freeze a value to enforce it is read-only. // This may also have minimal performance improvements for enumerating // objects (based on browser implementations, of course) declare function deepFreezeValue(value: mixed): any; module.exports = deepFreezeValue;