/** * 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 { RecoilValueReadOnly } from '../core/Recoil_RecoilValue'; const selectorFamily = require('./Recoil_selectorFamily'); const err = require('recoil-shared/util/Recoil_err'); // flowlint-next-line unclear-type:off const throwingSelector = selectorFamily({ key: '__error', get: message => () => { throw err(message); }, // TODO Why? cachePolicyForParams_UNSTABLE: { equality: 'reference' } }); // Function that returns a selector which always throws an error // with the provided message. declare function errorSelector(message: string): RecoilValueReadOnly; module.exports = errorSelector;