File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -355,6 +355,10 @@ function subscribeToSdkChanges(
355355 onFeatureUsage ( key , result ) ;
356356 }
357357 } ;
358+ if ( ! onFeatureUsage || typeof onFeatureUsage !== "function" ) {
359+ // @ts -expect-error
360+ gb . context . onFeatureUsage . isNoopCallback = true ;
361+ }
358362
359363 // Watch for incoming log events and send to tabstate
360364 updateTabState ( "logEvents" , [ ] ) ;
@@ -415,7 +419,10 @@ async function SDKHealthCheck(gb?: GrowthBook): Promise<SDKHealthCheckResult> {
415419
416420 const usingLogEvent = typeof gbContext ?. eventLogger === "function" ;
417421
418- const usingOnFeatureUsage = typeof gbContext ?. onFeatureUsage === "function" ;
422+ const onFeatureUsage = gbContext ?. onFeatureUsage ;
423+ const usingOnFeatureUsage =
424+ typeof onFeatureUsage === "function" &&
425+ ! onFeatureUsage . isNoopCallback ;
419426
420427 const isRemoteEval = ! ! gb . isRemoteEval ?.( ) ;
421428
You can’t perform that action at this time.
0 commit comments