* Set the value to the key passed in. * * If the key setting fails, an error will be thrown. * * @param key A string type key. * @param value plain object / number / boolean / string / array / null JSON type data, if not passed, it means delete this. * #### Example * ```js *
(key: string, value?: ICloudStorageValue)
| 107 | * ``` |
| 108 | */ |
| 109 | set(key: string, value?: ICloudStorageValue): void { |
| 110 | cmdExecute({ |
| 111 | cmd: CollaCommandName.SetGlobalStorage, |
| 112 | key, |
| 113 | value, |
| 114 | resourceType: ResourceType.Widget, |
| 115 | resourceId: this.widgetId, |
| 116 | }, this.widgetId).then(result => { |
| 117 | if (result.result !== ExecuteResult.Success) { |
| 118 | // TODO: replace with toast |
| 119 | alert('Operation execution failed'); |
| 120 | } |
| 121 | }); |
| 122 | } |
| 123 | } |
nothing calls this directly
no test coverage detected