Home Reference Source
public class | source

UserSettings

You can directly use an instance of this class. userSettings

Extends:

Events → UserSettings

storing/loading user settings/ sending to the user and in localstorage etc.

Constructor Summary

Public Constructor
public

Member Summary

Private Members
private
private
private
private

_settings: {}

private

_wasLoaded: boolean

Method Summary

Public Methods
public

get(key: *, defaultValue: undefined): *

public

getAll(): *

public

getLS(key: *): *

public

init()

public

load(settings: *)

public

reset()

public

save()

public

set(key: *, value: *)

public

setLS(key: *, value: *)

Inherited Summary

From class Events
public

off: *

public

on: *

private
private
private

_log: *

private

_logEvents: boolean

private

_logName: string

public

addEventListener(which: *, cb: *, idPrefix: string): string

add event listener

public

emitEvent(which: string, param1: *, param2: *, param3: *, param4: *, param5: *, param6: *)

emit event

public

hasEventListener(id: *, cb: *): boolean

check event listener registration

public

hasListenerForEventName(eventName: *): boolean

check event listener by name

public

logEvents(enabled: boolean, logName: string)

enable/disable logging of events for the class

public

removeEventListener(id: *, cb: *)

rempve event listener registration

Public Constructors

public constructor() source

Override:

Events#constructor

Private Members

private _LOCALSTORAGE_KEY: string source

private _lsSettings: * source

private _serverDelay: * source

private _settings: {} source

private _wasLoaded: boolean source

Public Methods

public get(key: *, defaultValue: undefined): * source

Params:

NameTypeAttributeDescription
key *
defaultValue undefined
  • optional
  • default: undefined

Return:

*

public getAll(): * source

Return:

*

public getLS(key: *): * source

Params:

NameTypeAttributeDescription
key *

Return:

*

public init() source

public load(settings: *) source

Params:

NameTypeAttributeDescription
settings *

public reset() source

public save() source

public set(key: *, value: *) source

Params:

NameTypeAttributeDescription
key *
value *

public setLS(key: *, value: *) source

Params:

NameTypeAttributeDescription
key *
value *