-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: add `getValueFromLocalStorage` service to app-config * docs: add documentation for the Get Value From Local Storage function * chore: update pull request template * docs: update service documents * chore: update app-config
- Loading branch information
1 parent
f76c8cf
commit c3d091f
Showing
20 changed files
with
474 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
documentation/docs/mock-apps/services/get-value-from-local-storage.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
sidebar_position: 28 | ||
title: Get Value From Local Storage | ||
--- | ||
|
||
import Disclaimer from '../../\_disclaimer.mdx'; | ||
|
||
<Disclaimer /> | ||
|
||
## Description | ||
|
||
The `getValueFromLocalStorage` service retrieves data from the browser's local storage. It takes a specific storage key to locate the data and an optional key to extract a particular value from the stored object. If no key is provided, the entire item is returned. Additionally, the function can update a provided state object with the retrieved data if a `stateKey` is specified. | ||
|
||
## Diagram | ||
|
||
```mermaid | ||
sequenceDiagram | ||
participant C as Client | ||
participant G as getValueFromLocalStorage | ||
participant L as LocalStorage | ||
C->>G: Call getValueFromLocalStorage(data, params) | ||
G->>L: Get data from LocalStorage (storageKey) | ||
L-->>G: Return stored data | ||
G->>G: Parse data and extract key (if specified) | ||
G->>G: Update state object (if stateKey is specified) | ||
G-->>C: Return retrieved data or updated state | ||
``` | ||
|
||
## Example | ||
|
||
```json | ||
{ | ||
"name": "getValueFromLocalStorage", | ||
"parameters": [ | ||
{ | ||
"storageKey": "topLineSteel_dpps", | ||
"key": "/vc" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
## Definitions | ||
|
||
| Property | Required | Description | Type | | ||
| ---------- | -------- | ------------------------------------------------------------------------------------------------ | ------ | | ||
| storageKey | Yes | The key used to locate the specific data in local storage | String | | ||
| key | No | The key to retrieve a specific value within the stored object. If not provided, returns all data | String | | ||
| stateKey | No | The key used to update the provided state object with the retrieved data | String | | ||
|
||
## Function type | ||
|
||
| Type | Description | | ||
| ---------- | ------------------------------------------------------------------------------------------------------------------------ | | ||
| ReturnData | It processes the input data or generates data independently and returns the processed result after successful execution. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.