AsyncStorageKeyValue
Defined in: atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:8
React Native AsyncStorage implementation of IKeyValueStorage. Provides a key-value storage backend using React Native's AsyncStorage.
Implements
IKeyValueStorage<true>
Constructors
Constructor
new AsyncStorageKeyValue(prefix): AsyncStorageKeyValue;
Defined in: atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:18
Creates a new AsyncStorageKeyValue instance
Parameters
| Parameter | Type | Description |
|---|---|---|
prefix | string | Prefix added to all keys to avoid collisions with other data |
Returns
AsyncStorageKeyValue
Properties
async
async: true = true;
Defined in: atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:9
Whether this storage backend is asynchronous
Implementation of
prefix
prefix: string;
Defined in: atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:12
Key prefix used to namespace storage entries
Methods
get()
get(key): Promise<string>;
Defined in: atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:37
Retrieves a value by key
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | The key to look up |
Returns
Promise<string>
The stored value, or null if not found
Implementation of
getAll()
getAll(keys): Promise<string[]>;
Defined in: atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:42
Retrieves multiple values by keys (optional batch operation)
Parameters
| Parameter | Type | Description |
|---|---|---|
keys | string[] | Array of keys to look up |
Returns
Promise<string[]>
Array of values in the same order as keys, null for missing keys
Implementation of
getKeys()
getKeys(): Promise<string[]>;
Defined in: atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:28
Returns all keys in the storage
Returns
Promise<string[]>
Array of all stored keys
Implementation of
init()
init(): Promise<void>;
Defined in: atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:23
Initializes the storage backend
Returns
Promise<void>
Implementation of
remove()
remove(key): Promise<void>;
Defined in: atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:49
Removes a value by key
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | The key to remove |
Returns
Promise<void>
Implementation of
removeAll()
removeAll(keys): Promise<void>;
Defined in: atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:54
Removes multiple values by keys (optional batch operation)
Parameters
| Parameter | Type | Description |
|---|---|---|
keys | string[] | Array of keys to remove |
Returns
Promise<void>
Implementation of
set()
set(key, value): Promise<void>;
Defined in: atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:59
Stores a value at the given key
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | The key to store under |
value | string | The string value to store |
Returns
Promise<void>
Implementation of
setAll()
setAll(values): Promise<void>;
Defined in: atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:64
Stores multiple key-value pairs (optional batch operation)
Parameters
| Parameter | Type | Description |
|---|---|---|
values | object[] | Array of key-value pairs to store |
Returns
Promise<void>