MCPcopy Create free account
hub / github.com/block/buzz / useFeatureEnabled

Function useFeatureEnabled

desktop/src/shared/features/useFeatureEnabled.ts:92–106  ·  view source on GitHub ↗
(featureId: string)

Source from the content-addressed store, hash-verified

90 * hide UI.
91 */
92export function useFeatureEnabled(featureId: string): boolean {
93 const overrides = useFeatureSnapshot();
94
95 const feature = getFeature(featureId);
96 if (!feature) {
97 if (import.meta.env.DEV) {
98 console.warn(
99 `[FeatureFlags] Unknown feature id: "${featureId}". Check preview-features.json.`,
100 );
101 }
102 return true;
103 }
104
105 return resolveEnabled(featureId, overrides);
106}
107
108/**
109 * Hook to toggle a feature override. Returns [enabled, toggle].

Callers 5

ProfilePrimaryActionsFunction · 0.90
AppShellFunction · 0.90
FeatureGateFunction · 0.90
useFeatureToggleFunction · 0.85
usePreviewFeatureWarningFunction · 0.85

Calls 4

getFeatureFunction · 0.90
resolveEnabledFunction · 0.90
useFeatureSnapshotFunction · 0.85
warnMethod · 0.80

Tested by

no test coverage detected