Get trending section indices from GrowthBook (#11319)
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
useSyncExternalStore,
|
||||
} from 'react'
|
||||
import {Platform} from 'react-native'
|
||||
import {type Result} from '@growthbook/growthbook-react'
|
||||
import {type Result, type WidenPrimitives} from '@growthbook/growthbook-react'
|
||||
|
||||
import {Logger} from '#/logger'
|
||||
import {
|
||||
@@ -67,6 +67,7 @@ export type AnalyticsContextType = {
|
||||
) => void
|
||||
features: typeof Features & {
|
||||
enabled(feature: Features): boolean
|
||||
getValue<T>(feature: Features, defaultValue: T): WidenPrimitives<T>
|
||||
}
|
||||
}
|
||||
export type AnalyticsBaseContextType = Omit<AnalyticsContextType, 'features'>
|
||||
@@ -83,6 +84,7 @@ function createLogger(
|
||||
warn: logger.warn.bind(logger),
|
||||
error: logger.error.bind(logger),
|
||||
useChild: (context: Exclude<Logger['context'], undefined>) => {
|
||||
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
||||
return useMemo(() => createLogger(context, metadata), [context, metadata])
|
||||
},
|
||||
Context: Logger.Context,
|
||||
@@ -314,6 +316,7 @@ export function AnalyticsFeaturesContext({
|
||||
...parentContext,
|
||||
features: {
|
||||
enabled: feats.isOn.bind(feats),
|
||||
getValue: feats.getFeatureValue.bind(feats),
|
||||
...Features,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user