Lime Web Components API Documentation - v6.24.0
    Preparing search index...

    Interface UserPreferencesRepositoryBeta

    Handle fetching and saving user preferences.

    interface UserPreferencesRepository {
        get<T = any>(key?: string): T;
        getSchema(): Record<string, unknown>;
        set<T = any>(key: string, data?: T): Promise<void>;
    }
    Index

    Methods

    Methods

    • Beta

      Get the current user preferences.

      Type Parameters

      • T = any

      Parameters

      • Optionalkey: string

        Supply the key for a specific preference to get only that value.

      Returns T

      If a key is supplied, the value stored under that key is returned. If no key is supplied, an object with all preferences is returned instead.

    • Beta

      Get the schema for the user preferences.

      Returns Record<string, unknown>

    • Beta

      Set or delete the value for a specific user preference.

      Type Parameters

      • T = any

      Parameters

      • key: string

        The key to store the value under.

      • Optionaldata: T

        The data to save. Leave undefined to instead delete the currently stored value.

      Returns Promise<void>

      a promise that will be resolved when the data has been saved

      The value set must be serializable as JSON. If non-serializable data is given, it might result in an error, but more likely, the data will simply be lost.