Package com.vaadin.flow.component.page
Interface WebStorage.WebStorageJs
- All Superinterfaces:
Serializable
- Enclosing interface:
WebStorage
What web storage asks of the browser, as a JavaScript definition for
Page.executeJs(Class).
Which storage is worked on is a parameter rather than a declaration of its own, so the bundle carries one function per operation.
- Since:
- 25.4
-
Method Summary
Modifier and TypeMethodDescriptionvoidRemoves every value of a storage.Reads the value of a key.voidremoveItem(String storage, String key) Removes the value of a key.voidWrites a value.
-
Method Details
-
setItem
Writes a value.- Parameters:
storage- the name of the storage on the windowkey- the key to write undervalue- the value to write
-
removeItem
Removes the value of a key.- Parameters:
storage- the name of the storage on the windowkey- the key to remove
-
clear
Removes every value of a storage.- Parameters:
storage- the name of the storage on the window
-
getItem
@JsExpression("return window[$0].getItem($1);") PendingJavaScriptResult getItem(String storage, String key) Reads the value of a key.- Parameters:
storage- the name of the storage on the windowkey- the key to read- Returns:
- the pending result, which answers with the value or with
nullwhen the key has none
-