diff options
author | dan <dan.abramov@gmail.com> | 2024-04-10 19:36:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-10 19:36:37 +0100 |
commit | 427f3a848d3bdc2e9c4b6b7cb2b8699511339ee2 (patch) | |
tree | e50dd6fc56e45170730223c53180389cfab676cf /src/lib/statsig/statsig.tsx | |
parent | bf974b147ec8ba2b84803d17f8ca1f9291726ed2 (diff) | |
download | voidsky-427f3a848d3bdc2e9c4b6b7cb2b8699511339ee2.tar.zst |
[Statsig] Typecheck gates (#3467)
* Typecheck gates * Lint against untyped useGate() * Alphabetic
Diffstat (limited to 'src/lib/statsig/statsig.tsx')
-rw-r--r-- | src/lib/statsig/statsig.tsx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/statsig/statsig.tsx b/src/lib/statsig/statsig.tsx index c16461621..18b58d16d 100644 --- a/src/lib/statsig/statsig.tsx +++ b/src/lib/statsig/statsig.tsx @@ -11,6 +11,7 @@ import { import {logger} from '#/logger' import {useSession} from '../../state/session' import {LogEvents} from './events' +import {Gate} from './gates' export type {LogEvents} @@ -69,7 +70,7 @@ export function logEvent<E extends keyof LogEvents>( } } -export function useGate(gateName: string) { +export function useGate(gateName: Gate): boolean { const {isLoading, value} = useStatsigGate(gateName) if (isLoading) { // This should not happen because of waitForInitialization={true}. |