From 8521d37858cd7b857def682fb14e61f48d80dd69 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Fri, 1 Nov 2024 15:30:28 -0300 Subject: [PATCH] Polishing --- src/__tests__/index.test.ts | 1 + src/__tests__/useSplitClient.test.tsx | 4 +--- src/types.ts | 6 ++++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/__tests__/index.test.ts b/src/__tests__/index.test.ts index 199610c..a455af6 100644 --- a/src/__tests__/index.test.ts +++ b/src/__tests__/index.test.ts @@ -17,6 +17,7 @@ import { ISplitClientChildProps, ISplitClientProps, ISplitContextValues, + ISplitFactoryChildProps, ISplitFactoryProviderProps, ISplitStatus, ISplitTreatmentsChildProps, diff --git a/src/__tests__/useSplitClient.test.tsx b/src/__tests__/useSplitClient.test.tsx index 4bc5124..a1e6790 100644 --- a/src/__tests__/useSplitClient.test.tsx +++ b/src/__tests__/useSplitClient.test.tsx @@ -95,9 +95,7 @@ describe('useSplitClient', () => { {() => countSplitContext++} {React.createElement(() => { - // Equivalent to - // - Using config key: `const { client } = useSplitClient({ splitKey: sdkBrowser.core.key, attributes: { att1: 'att1' } });` - // - Disabling update props, since the wrapping SplitFactoryProvider has them enabled: `const { client } = useSplitClient({ attributes: { att1: 'att1' }, updateOnSdkReady: false, updateOnSdkReadyFromCache: false });` + // Equivalent to using config key: `const { client } = useSplitClient({ splitKey: sdkBrowser.core.key, attributes: { att1: 'att1' } });` const { client } = useSplitClient({ attributes: { att1: 'att1' } }); expect(client).toBe(mainClient); // Assert that the main client was retrieved. expect(client!.getAttributes()).toEqual({ att1: 'att1' }); // Assert that the client was retrieved with the provided attributes. diff --git a/src/types.ts b/src/types.ts index cebbab2..3360db0 100644 --- a/src/types.ts +++ b/src/types.ts @@ -95,14 +95,16 @@ export interface IUpdateProps { /** * `updateOnSdkReadyFromCache` indicates if the component will update (i.e., re-render) in case of a `SDK_READY_FROM_CACHE` event. * If `true`, components consuming the context (such as `SplitClient` and `SplitTreatments`) will re-render on `SDK_READY_FROM_CACHE`. - * This params is only relevant when using 'LOCALSTORAGE' as storage type, since otherwise the event is never emitted. + * This params is only relevant when using `'LOCALSTORAGE'` as storage type, since otherwise the event is never emitted. * It's value is `true` by default. */ updateOnSdkReadyFromCache?: boolean; } /** - * SplitFactoryProvider Child Props interface. These are the props that the child component receives from the 'withSplitFactory' HOC. + * Props interface for components wrapped by the `withSplitFactory` HOC. These props are provided by the HOC to the wrapped component. + * + * @deprecated `withSplitFactory` will be removed in a future major release. We recommend replacing it with the `SplitFactoryProvider` component. */ export interface ISplitFactoryChildProps extends ISplitContextValues { }