Skip to content

Commit 2f77738

Browse files
authored
fix: invocation hooks not called (#916)
- fixes issue where invocation hooks were not called in the React SDK - adds associated tests Fixes: #914 --------- Signed-off-by: Todd Baert <[email protected]>
1 parent e4287ed commit 2f77738

File tree

2 files changed

+499
-321
lines changed

2 files changed

+499
-321
lines changed

packages/react/src/evaluation/use-feature-flag.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
Client,
33
EvaluationDetails,
4+
FlagEvaluationOptions,
45
FlagValue,
56
JsonValue,
67
ProviderEvents,
@@ -241,7 +242,7 @@ export function useObjectFlagDetails<T extends JsonValue = JsonValue>(
241242
function attachHandlersAndResolve<T extends FlagValue>(
242243
flagKey: string,
243244
defaultValue: T,
244-
resolver: (client: Client) => (flagKey: string, defaultValue: T) => EvaluationDetails<T>,
245+
resolver: (client: Client) => (flagKey: string, defaultValue: T, options?: FlagEvaluationOptions) => EvaluationDetails<T>,
245246
options?: ReactFlagEvaluationOptions,
246247
): EvaluationDetails<T> {
247248
// highest priority > evaluation hook options > provider options > default options > lowest priority
@@ -296,7 +297,7 @@ function attachHandlersAndResolve<T extends FlagValue>(
296297
};
297298
}, []);
298299

299-
return resolver(client).call(client, flagKey, defaultValue);
300+
return resolver(client).call(client, flagKey, defaultValue, options);
300301
}
301302

302303
// FlagQuery implementation, do not export

0 commit comments

Comments
 (0)