English
storageSet
About 91 wordsLess than 1 minute
2025-04-28
This method allows you to store data inside the application. It is recommended to add a namespace to the key to avoid simple key collisions.
FxUI.storage.set(key: String, value:any)Parameters
| Parameter | Description | Type | Optional Values | Default |
|---|---|---|---|---|
| key | Unique storage key | string | — | — |
| value | Value to store | any | — | — |
Code Example
This method returns a Promise object, as shown below:
import FxUI from 'fxui-mobile';
FxUI.storage.set('FXUI_TEST_DATA',{ num: Date.now() }).then((res) => {
if(res.success === true) {
console.log('set success callback', res)
}else{
console.log('set failure callback', err)
}
})