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

    Interface DataManager

    interface DataManager {
        close(): void;
        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;
    }

    Hierarchy (View Summary)

    Implemented by

    Index
    • 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

    • Set a callback to flush pending analytics events. Called immediately (not debounced) when the lifecycle transitions to background.

      Optional — only FDv2 data managers implement this.

      Parameters

      • callback: () => void

      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