UNPKG

@ninetailed/experience.js-react

Version:
26 lines (25 loc) 722 B
import { AllowedVariableType } from '@ninetailed/experience.js-shared'; export type FlagResult<T> = { status: 'loading'; value: T; error: null; } | { status: 'success'; value: T; error: null; } | { status: 'error'; value: T; error: Error; }; type UseFlagOptions = { shouldAutoTrack?: boolean | (() => boolean); }; /** * Hook to access a Ninetailed variable flag with built-in auto-tracking. * * @remarks * For manual control over tracking behavior, consider using {@link useFlagWithManualTracking}. */ export declare function useFlag<T extends AllowedVariableType>(flagKey: string, defaultValue: T, options?: UseFlagOptions): FlagResult<T>; export {};