@ninetailed/experience.js-react
Version:
Ninetailed SDK for React
20 lines (19 loc) • 592 B
TypeScript
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;
};
export type FlagResultWithTracking<T> = [FlagResult<T>, () => void];
/**
* Hook to access a Ninetailed variable flag with manual tracking control.
*/
export declare function useFlagWithManualTracking<T extends AllowedVariableType>(flagKey: string, defaultValue: T): FlagResultWithTracking<T>;