UNPKG

@splitsoftware/splitio-react

Version:

A React library to easily integrate and use Split JS SDK

16 lines (15 loc) 879 B
import { ISplitContextValues, IUseSplitClientOptions } from './types'; /** * `useSplitClient` is a hook that returns an Split Context object with the client and its status corresponding to the provided key. * * @param options - An options object with an optional `splitKey` to retrieve the client, optional `attributes` to configure the client, and update options to control on which SDK events the hook should update. * @returns A Split Context object merged with the client and its status. * * @example * ```js * const { factory, client, isReady, isReadyFromCache, hasTimedout, lastUpdate } = useSplitClient({ splitKey: 'user_id' }); * ``` * * @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#advanced-instantiate-multiple-sdk-clients} */ export declare function useSplitClient(options?: IUseSplitClientOptions): ISplitContextValues;