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