Class: AppSettings
appLib/SDKDrivers/xFrameDriver/appSettings.AppSettings
Settings repository.
The Settings class allows you to manage the settings of the app.
Implements
IBundle
Hierarchy
-
Repository
↳
AppSettings
Implements
-
IBundle
<iAppSettings
>
Table of contents
Constructors
Methods
Constructors
constructor
• new AppSettings(agent
)
Creates an instance of Repository.
Parameters
Name | Type |
---|---|
agent |
PeerAgent |
Inherited from
Methods
crudReq
▸ crudReq(data
): void
Sends a CRUD request to the xFrame.
Parameters
Name | Type |
---|---|
data |
any |
Returns
void
Inherited from
crudReqSync
▸ crudReqSync(data
, options?
): Promise
<any
>
Sends a CRUD request to the xFrame.
Parameters
Name | Type | Description |
---|---|---|
data |
any |
The data to send. |
options |
Object |
|
options.timeout? |
number |
an option to set the timeout for the request. |
Returns
Promise
<any
>
Inherited from
get
▸ get(setting?
): Promise
<iAppSettings
>
Retrieves the settings of your app.
Example
const generalSettings = await dl.settings.get()
const { theme, currentUser } = generalSettings
Example
const setting = await dl.settings.get('userSettingName')
Parameters
Name | Type | Description |
---|---|---|
setting? |
string |
The name of the user setting to retrieve. |
Returns
Promise
<iAppSettings
>
- A promise that resolves to the settings of the app.
Implementation of
IBundle.get