@launchdarkly/react-native-client-sdk - v10.23.6
    Preparing search index...

    Interface FlagManager

    Top level manager of flags for the client. LDClient should be using this interface and not any of the specific instances managed by it. Updates from data sources should be directed to the [init] and [upsert] methods of this interface.

    interface FlagManager {
        applyChanges(
            context: Context,
            updates: { [key: string]: ItemDescriptor },
            type: PayloadType,
        ): Promise<void>;
        get(key: string): ItemDescriptor | undefined;
        getAll(): { [key: string]: ItemDescriptor };
        getDebugOverride?(): LDDebugOverride;
        init(
            context: Context,
            newFlags: { [key: string]: ItemDescriptor },
        ): Promise<void>;
        loadCached(context: Context): Promise<boolean>;
        off(callback: FlagsChangeCallback): void;
        on(callback: FlagsChangeCallback): void;
        presetFlags(newFlags: { [key: string]: ItemDescriptor }): void;
        setBootstrap(
            context: Context,
            newFlags: { [key: string]: ItemDescriptor },
        ): void;
        upsert(
            context: Context,
            key: string,
            item: ItemDescriptor,
        ): Promise<boolean>;
    }
    Index
    • Applies a changeset to the flag store.

      • 'full': replaces all flags (like init).
      • 'partial': upserts individual flags (like calling upsert for each entry).
      • 'none': persists cache (updating freshness) without changing any flags.

      Designed for the FDv2 data path where init/upsert semantics, selector tracking, and freshness updates are all handled in one call.

      Parameters

      Returns Promise<void>

    • Attempts to get a flag by key from the current flags.

      Parameters

      • key: string

      Returns ItemDescriptor | undefined

    • Gets all the current flags.

      Returns { [key: string]: ItemDescriptor }

    • Experimental

      Obtain debug override functions that allows plugins to manipulate the outcome of the flags managed by this manager

      This function is experimental and intended for use by LaunchDarkly tools at this time.

      Returns LDDebugOverride

    • Initializes the flag manager with data from a data source. Persistence initialization is handled by FlagPersistence

      Parameters

      Returns Promise<void>

    • Asynchronously load cached values from persistence.

      Parameters

      Returns Promise<boolean>

    • Unregister a flag change callback.

      Parameters

      • callback: FlagsChangeCallback

      Returns void

    • Register a flag change callback.

      Parameters

      • callback: FlagsChangeCallback

      Returns void

    • Updates in-memory storage with the specified flags without a context or persistent storage. Flags set in this way are considered emphemeral and should be replaced as soon as initialization is done.

      Parameters

      Returns void

    • Update in-memory storage with the specified flags, but do not persistent them to cache storage.

      Parameters

      Returns void

    • Attempt to update a flag. If the flag is for the wrong context, or it is of an older version, then an update will not be performed.

      Parameters

      Returns Promise<boolean>