IAsyncStorage interface
Methods
contains |
Returns true or false if the given key is present in the cache. |
get |
Get the item from the asynchronous storage object matching the given key. |
get |
Get all the keys from the asynchronous storage object as an iterable array of strings. |
remove |
Removes the item in the asynchronous storage object matching the given key. |
set |
Sets the item in the asynchronous storage object with the given key. |
Method Details
containsKey(string)
Returns true or false if the given key is present in the cache.
function containsKey(key: string): Promise<boolean>
Parameters
- key
-
string
Returns
Promise<boolean>
getItem(string)
Get the item from the asynchronous storage object matching the given key.
function getItem(key: string): Promise<T | null>
Parameters
- key
-
string
Returns
Promise<T | null>
getKeys()
Get all the keys from the asynchronous storage object as an iterable array of strings.
function getKeys(): Promise<string[]>
Returns
Promise<string[]>
removeItem(string)
Removes the item in the asynchronous storage object matching the given key.
function removeItem(key: string): Promise<void>
Parameters
- key
-
string
Returns
Promise<void>
setItem(string, T)
Sets the item in the asynchronous storage object with the given key.
function setItem(key: string, value: T): Promise<void>
Parameters
- key
-
string
- value
-
T
Returns
Promise<void>