ReactNativeAsyncStorage interface
Stay organized with collections
Save and categorize content based on your preferences.
Interface for a supplied AsyncStorage
.
Signature:
export interface ReactNativeAsyncStorage
Methods
ReactNativeAsyncStorage.getItem()
Retrieve an item from storage.
Signature:
getItem(key: string): Promise<string | null>;
Parameters
Parameter |
Type |
Description |
key |
string |
storage key. |
Returns:
Promise<string | null>
ReactNativeAsyncStorage.removeItem()
Remove an item from storage.
Signature:
removeItem(key: string): Promise<void>;
Parameters
Parameter |
Type |
Description |
key |
string |
storage key. |
Returns:
Promise<void>
ReactNativeAsyncStorage.setItem()
Persist an item in storage.
Signature:
setItem(key: string, value: string): Promise<void>;
Parameters
Parameter |
Type |
Description |
key |
string |
storage key. |
value |
string |
storage value. |
Returns:
Promise<void>
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-01-19 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-01-19 UTC."],[],[],null,["# ReactNativeAsyncStorage interface\n\nInterface for a supplied `AsyncStorage`.\n\n**Signature:** \n\n export interface ReactNativeAsyncStorage \n\nMethods\n-------\n\n| Method | Description |\n|-----------------------------------------------------------------------------------------|--------------------------------|\n| [getItem(key)](./auth.reactnativeasyncstorage.md#reactnativeasyncstoragegetitem) | Retrieve an item from storage. |\n| [removeItem(key)](./auth.reactnativeasyncstorage.md#reactnativeasyncstorageremoveitem) | Remove an item from storage. |\n| [setItem(key, value)](./auth.reactnativeasyncstorage.md#reactnativeasyncstoragesetitem) | Persist an item in storage. |\n\nReactNativeAsyncStorage.getItem()\n---------------------------------\n\nRetrieve an item from storage.\n\n**Signature:** \n\n getItem(key: string): Promise\u003cstring | null\u003e;\n\n#### Parameters\n\n| Parameter | Type | Description |\n|-----------|--------|--------------|\n| key | string | storage key. |\n\n**Returns:**\n\nPromise\\\u003cstring \\| null\\\u003e\n\nReactNativeAsyncStorage.removeItem()\n------------------------------------\n\nRemove an item from storage.\n\n**Signature:** \n\n removeItem(key: string): Promise\u003cvoid\u003e;\n\n#### Parameters\n\n| Parameter | Type | Description |\n|-----------|--------|--------------|\n| key | string | storage key. |\n\n**Returns:**\n\nPromise\\\u003cvoid\\\u003e\n\nReactNativeAsyncStorage.setItem()\n---------------------------------\n\nPersist an item in storage.\n\n**Signature:** \n\n setItem(key: string, value: string): Promise\u003cvoid\u003e;\n\n#### Parameters\n\n| Parameter | Type | Description |\n|-----------|--------|----------------|\n| key | string | storage key. |\n| value | string | storage value. |\n\n**Returns:**\n\nPromise\\\u003cvoid\\\u003e"]]