File

src/core/user-profile/common/smart-user-profile.ts

Description

Copyright © 2006-2026 by Consultingwerk Ltd. ("CW") - * www.consultingwerk.com and other contributors as listed * below. All Rights Reserved. * * Software is distributed on an "AS IS", WITHOUT WARRANTY OF ANY * KIND, either express or implied. * * Contributors: * *

Index

Methods
Accessors

Constructor

constructor(initialValues: T, profileType: string, profileName: string, profileKey: string)
Parameters :
Name Type Optional
initialValues T No
profileType string No
profileName string No
profileKey string No

Methods

Public clearChangedKeys
clearChangedKeys()

Clears the tracked changed keys. Called after successful persistence.

Returns : void
Public getChangedKeys
getChangedKeys()

Gets the keys that have been changed since the profile was created or last cleared.

Returns : unknown[]

Array of changed keys

Public getChangedValues
getChangedValues()

Gets only the changed values from this profile.

Returns : Partial<T>

Object containing only the changed key-value pairs

Public getValue
getValue(key: unknown, defaultValue?: T)
Type parameters :
  • P

Retrieves a value stored in the user profle

Parameters :
Name Type Optional Description
key unknown No
defaultValue T Yes

the default value to return if the key is not already stored

Returns : P

T[typeof key]

Public hasValue
hasValue(key: unknown)

Indicates if this user profile contains a value for the given key

Parameters :
Name Type Optional
key unknown No
Returns : boolean

boolean

Public setValue
setValue(key: unknown, value: T)

Updates a value of the user's profile locally

Parameters :
Name Type Optional
key unknown No
value T No
Returns : void
Public toObject
toObject()

A simple object representation of this User Profile

Returns : T

T

Accessors

userProfleKey
getuserProfleKey()

The User Profile Key

Returns : string
userProfileType
getuserProfileType()

The User Profile Type

Returns : string
userProfileName
getuserProfileName()

The User Profile name

Returns : string

results matching ""

    No results matching ""