@launchdarkly/js-client-sdk-common - v1.35.0
    Preparing search index...

    Interface FDv2DataManagerControl

    The public interface returned by createFDv2DataManagerBase. Extends DataManager with mode control methods.

    interface FDv2DataManagerControl {
        configuredForegroundMode: FDv2ConnectionMode;
        close(): void;
        getCurrentMode(): FDv2ConnectionMode;
        identify(
            identifyResolve: () => void,
            identifyReject: (err: Error) => void,
            context: Context,
            identifyOptions?: LDIdentifyOptions,
        ): Promise<void>;
        setAutomaticStreamingState?(streaming: boolean): void;
        setConnectionMode(mode?: FDv2ConnectionMode): void;
        setFlushCallback(callback: () => void): void;
        setForcedStreaming?(streaming?: boolean): void;
        setLifecycleState(state: LifecycleState): void;
        setNetworkState(state: NetworkState): void;
    }

    Hierarchy (View Summary)

    Index
    configuredForegroundMode: FDv2ConnectionMode

    The configured default foreground mode (from config, not auto-promoted).

    • This function handles the data management aspects of the identification process.

      Implementation Note: The identifyResolve and identifyReject function resolve or reject the identify function at LDClient level. It is likely in individual implementations that these functions will be passed to other components, such as a datasource, do indicate when the identify process has been completed. The data manager identify function should return once everything has been set in motion to complete the identification process.

      Parameters

      • identifyResolve: () => void

        Called to reject the identify operation.

      • identifyReject: (err: Error) => void

        Called to complete the identify operation.

      • context: Context

        The context being identified.

      • OptionalidentifyOptions: LDIdentifyOptions

        Options for identification.

      Returns Promise<void>

    • Update the automatic streaming state based on whether change listeners are registered. When true and forced streaming is not set, the data manager should activate streaming.

      Optional — only browser data managers implement this.

      Parameters

      • streaming: boolean

      Returns void

    • Force streaming on or off. When true, the data manager should maintain a streaming connection. When false, streaming is disabled. When undefined, the forced state is cleared and automatic behavior takes over.

      Optional — only browser data managers implement this.

      Parameters

      • Optionalstreaming: boolean

      Returns void