@@ -11,8 +11,8 @@ import {
11
11
ProviderStatus ,
12
12
} from '@openfeature/web-sdk' ;
13
13
import { useEffect , useRef , useState } from 'react' ;
14
- import type { ReactFlagEvaluationOptions } from '../common ' ;
15
- import { DEFAULT_OPTIONS , isEqual , normalizeOptions , suspendUntilReady , useProviderOptions } from '../common ' ;
14
+ import type { ReactFlagEvaluationNoSuspenseOptions , ReactFlagEvaluationOptions } from '../options ' ;
15
+ import { DEFAULT_OPTIONS , isEqual , normalizeOptions , suspendUntilReady , useProviderOptions } from '../internal ' ;
16
16
import { useOpenFeatureClient } from '../provider/use-open-feature-client' ;
17
17
import { useOpenFeatureClientStatus } from '../provider/use-open-feature-client-status' ;
18
18
import type { FlagQuery } from '../query' ;
@@ -33,9 +33,6 @@ type ConstrainedFlagQuery<T> = FlagQuery<
33
33
: JsonValue
34
34
> ;
35
35
36
- // suspense options removed for the useSuspenseFlag hooks
37
- type NoSuspenseOptions = Omit < ReactFlagEvaluationOptions , 'suspend' | 'suspendUntilReady' | 'suspendWhileReconciling' > ;
38
-
39
36
/**
40
37
* Evaluates a feature flag generically, returning an react-flavored queryable object.
41
38
* The resolver method to use is based on the type of the defaultValue.
@@ -84,13 +81,13 @@ type UseFlagReturn<T extends FlagValue> = ReturnType<typeof useFlag<T>>;
84
81
* @param {string } flagKey the flag identifier
85
82
* @template {FlagValue} T A optional generic argument constraining the default.
86
83
* @param {T } defaultValue the default value; used to determine what resolved type should be used.
87
- * @param {NoSuspenseOptions } options for this evaluation
84
+ * @param {ReactFlagEvaluationNoSuspenseOptions } options for this evaluation
88
85
* @returns { UseFlagReturn<T> } a queryable object containing useful information about the flag.
89
86
*/
90
87
export function useSuspenseFlag < T extends FlagValue = FlagValue > (
91
88
flagKey : string ,
92
89
defaultValue : T ,
93
- options ?: NoSuspenseOptions ,
90
+ options ?: ReactFlagEvaluationNoSuspenseOptions ,
94
91
) : UseFlagReturn < T > {
95
92
return useFlag ( flagKey , defaultValue , { ...options , suspendUntilReady : true , suspendWhileReconciling : true } ) ;
96
93
}
0 commit comments