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

    Class CompositeDataSource

    The CompositeDataSource can combine a number of DataSystemInitializers and DataSystemSynchronizers into a single DataSource, implementing fallback and recovery logic internally to choose where data is sourced from.

    Implements

    Index
    • Parameters

      • initializers: LDDataSourceFactory[]

        factories to create DataSystemInitializers, in priority order.

      • synchronizers: LDDataSourceFactory[]

        factories to create DataSystemSynchronizers, in priority order.

      • fdv1Synchronizers: LDDataSourceFactory[]

        factories to fallback to if we need to fallback to FDv1.

      • Optional_logger: LDLogger

        for logging

      • Optional_transitionConditions: TransitionConditions

        to control automated transition between datasources. Typically only used for testing.

      • Optional_backoff: Backoff

        to control delay between transitions. Typically only used for testing.

      Returns CompositeDataSource

    • May be called any number of times, if already started, has no effect

      Parameters

      • dataCallback: (basis: boolean, data: any) => void

        that will be called when data arrives, may be called multiple times.

      • statusCallback: (status: subsystem.DataSourceState, err?: any) => void

        that will be called when data source state changes or an unrecoverable error has been encountered.

      • OptionalselectorGetter: () => string | undefined

        that can be invoked to provide the FDv2 selector/basis if one exists

      Returns Promise<void>

    • May be called any number of times, if already stopped, has no effect. Datasource will not make any additional callbacks after stop returns.

      Returns Promise<void>