962 B31 lines
Blame
1/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8import {atom} from 'jotai';
9import serverAPI from '../ClientToServerAPI';
10import {atomWithOnChange, localStorageBackedAtom} from '../jotaiUtils';
11
12export const enableReduxTools = localStorageBackedAtom<boolean>('isl.debug-redux-tools', false);
13
14export const enableReactTools = localStorageBackedAtom<boolean>('isl.debug-react-tools', false);
15
16export const enableSaplingDebugFlag = atomWithOnChange<boolean>(
17 atom(false),
18 enabled => {
19 serverAPI.postMessage({type: 'setDebugLogging', name: 'debug', enabled});
20 },
21 /* skipInitialCall */ true,
22);
23
24export const enableSaplingVerboseFlag = atomWithOnChange<boolean>(
25 atom(false),
26 enabled => {
27 serverAPI.postMessage({type: 'setDebugLogging', name: 'verbose', enabled});
28 },
29 /* skipInitialCall */ true,
30);
31