mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
22 lines
721 B
JavaScript
22 lines
721 B
JavaScript
import {
|
|
localStorageGetItem,
|
|
localStorageRemoveItem,
|
|
} from 'react-devtools-shared/src/storage';
|
|
import {LOCAL_STORAGE_SUPPORTS_PROFILING_KEY} from 'react-devtools-shared/src/constants';
|
|
|
|
function getProfilingFlags() {
|
|
// This flag lets us tip the Store off early that we expect to be profiling.
|
|
// This avoids flashing a temporary "Profiling not supported" message in the Profiler tab,
|
|
// after a user has clicked the "reload and profile" button.
|
|
let isProfiling = false;
|
|
|
|
if (localStorageGetItem(LOCAL_STORAGE_SUPPORTS_PROFILING_KEY) === 'true') {
|
|
isProfiling = true;
|
|
localStorageRemoveItem(LOCAL_STORAGE_SUPPORTS_PROFILING_KEY);
|
|
}
|
|
|
|
return {isProfiling};
|
|
}
|
|
|
|
export default getProfilingFlags;
|