addons/isl/src/atoms/debugToolAtoms.tsblame
View source
b69ab311/**
b69ab312 * Copyright (c) Meta Platforms, Inc. and affiliates.
b69ab313 *
b69ab314 * This source code is licensed under the MIT license found in the
b69ab315 * LICENSE file in the root directory of this source tree.
b69ab316 */
b69ab317
b69ab318import {atom} from 'jotai';
b69ab319import serverAPI from '../ClientToServerAPI';
b69ab3110import {atomWithOnChange, localStorageBackedAtom} from '../jotaiUtils';
b69ab3111
b69ab3112export const enableReduxTools = localStorageBackedAtom<boolean>('isl.debug-redux-tools', false);
b69ab3113
b69ab3114export const enableReactTools = localStorageBackedAtom<boolean>('isl.debug-react-tools', false);
b69ab3115
b69ab3116export const enableSaplingDebugFlag = atomWithOnChange<boolean>(
b69ab3117 atom(false),
b69ab3118 enabled => {
b69ab3119 serverAPI.postMessage({type: 'setDebugLogging', name: 'debug', enabled});
b69ab3120 },
b69ab3121 /* skipInitialCall */ true,
b69ab3122);
b69ab3123
b69ab3124export const enableSaplingVerboseFlag = atomWithOnChange<boolean>(
b69ab3125 atom(false),
b69ab3126 enabled => {
b69ab3127 serverAPI.postMessage({type: 'setDebugLogging', name: 'verbose', enabled});
b69ab3128 },
b69ab3129 /* skipInitialCall */ true,
b69ab3130);