mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-28 15:14:06 +00:00
21 lines
564 B
JavaScript
21 lines
564 B
JavaScript
import { useSelector } from 'react-redux';
|
|
|
|
/**
|
|
* Beta features configuration object
|
|
* Contains all available beta feature keys
|
|
*/
|
|
export const BETA_FEATURES = Object.freeze({
|
|
GRPC: 'grpc',
|
|
NODE_VM: 'nodevm'
|
|
});
|
|
|
|
/**
|
|
* Hook to check if a beta feature is enabled
|
|
* @param {string} featureName - The name of the beta feature
|
|
* @returns {boolean} - Whether the feature is enabled
|
|
*/
|
|
export const useBetaFeature = (featureName) => {
|
|
const preferences = useSelector((state) => state.app.preferences);
|
|
return preferences?.beta?.[featureName] || false;
|
|
};
|