Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ProfileClient

A simple wrapper class to assist with setting and retrieving profile features.

You will still need to register profile features using the usual context.registerProfileFeature syntax, but you can then easily set/get that feature with a ProfileClient instance.

remarks

If you are not familiar with how Vortex handles profile features, be very careful. This can be a minefield.

example
var client = new ProfileClient(context.api.store);
var feature = client.getProfileSetting('some_profile_feature', 'default value');
client.setProfileSetting('some_profile_feature', 'new value');

Hierarchy

  • ProfileClient

Index

Constructors

constructor

  • Creates a new instance of the profile client.

    remarks
    • Using the store param directly is strongly recommended over providing the IExtensionApi object!

    Parameters

    • store: ThunkStore<any>

      The state store object (usually from IExtensionApi.store)

    Returns ProfileClient

  • Parameters

    • context: IExtensionApi

    Returns ProfileClient

Methods

getProfileSetting

  • getProfileSetting<TSetting>(profile: IProfile, key: string, defaultValue: TSetting): TSetting
  • getProfileSetting<TSetting>(key: string, defaultValue: TSetting): TSetting
  • Retrieves the value of a given profile feature/setting on a given profile.

    Type parameters

    • TSetting

    Parameters

    • profile: IProfile

      The profile to retreive the value from.

    • key: string

      The unique key for the profile feature/setting.

    • defaultValue: TSetting

      The default value to return if the feature does not exist or does not have a value.

    Returns TSetting

  • Type parameters

    • TSetting

    Parameters

    • key: string
    • defaultValue: TSetting

    Returns TSetting

setProfileSetting

  • setProfileSetting<TSetting>(profile: IProfile, key: string, value: TSetting): void
  • Sets the value of a given profile feature/setting on a given profile.

    Type parameters

    • TSetting

    Parameters

    • profile: IProfile

      The profile to set the value on.

    • key: string

      The unique key for the profile feature/setting.

    • value: TSetting

      The value to set/update for the profile feature/setting.

    Returns void

Generated using TypeDoc