Files
resolutionflow/frontend/src/hooks/useFeatureFlag.ts
chihlasm cc929c8932 feat: add useFeatureFlag hook for feature gating
Selector-based hook reads from authStore.featureFlags.
Returns false for unknown keys (fail closed).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 15:20:53 +00:00

10 lines
283 B
TypeScript

import { useAuthStore } from '@/store/authStore'
/**
* Check if a feature flag is enabled for the current user.
* Returns false for unknown keys (fail closed).
*/
export function useFeatureFlag(key: string): boolean {
return useAuthStore((s) => s.featureFlags[key] ?? false)
}