Skip to main content

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

Constructors

Constructor

new AsyncStorageKeyValue(prefix): AsyncStorageKeyValue;

Defined in: atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:18

Creates a new AsyncStorageKeyValue instance

Parameters

ParameterTypeDescription
prefixstringPrefix 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

IKeyValueStorage.async


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

ParameterTypeDescription
keystringThe key to look up

Returns

Promise<string>

The stored value, or null if not found

Implementation of

IKeyValueStorage.get


getAll()

getAll(keys): Promise<string[]>;

Defined in: atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:42

Retrieves multiple values by keys (optional batch operation)

Parameters

ParameterTypeDescription
keysstring[]Array of keys to look up

Returns

Promise<string[]>

Array of values in the same order as keys, null for missing keys

Implementation of

IKeyValueStorage.getAll


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

IKeyValueStorage.getKeys


init()

init(): Promise<void>;

Defined in: atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:23

Initializes the storage backend

Returns

Promise<void>

Implementation of

IKeyValueStorage.init


remove()

remove(key): Promise<void>;

Defined in: atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:49

Removes a value by key

Parameters

ParameterTypeDescription
keystringThe key to remove

Returns

Promise<void>

Implementation of

IKeyValueStorage.remove


removeAll()

removeAll(keys): Promise<void>;

Defined in: atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:54

Removes multiple values by keys (optional batch operation)

Parameters

ParameterTypeDescription
keysstring[]Array of keys to remove

Returns

Promise<void>

Implementation of

IKeyValueStorage.removeAll


set()

set(key, value): Promise<void>;

Defined in: atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:59

Stores a value at the given key

Parameters

ParameterTypeDescription
keystringThe key to store under
valuestringThe string value to store

Returns

Promise<void>

Implementation of

IKeyValueStorage.set


setAll()

setAll(values): Promise<void>;

Defined in: atomiq-storage-rn-async/src/AsyncStorageKeyValue.ts:64

Stores multiple key-value pairs (optional batch operation)

Parameters

ParameterTypeDescription
valuesobject[]Array of key-value pairs to store

Returns

Promise<void>

Implementation of

IKeyValueStorage.setAll