@umituz/react-native-storage 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -53,4 +53,16 @@ export interface IStorageRepository {
|
|
|
53
53
|
* Get multiple items at once
|
|
54
54
|
*/
|
|
55
55
|
getMultiple(keys: string[]): Promise<StorageResult<Record<string, string | null>>>;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Get object from storage (alias for getItem for backward compatibility)
|
|
59
|
+
* @deprecated Use getItem instead
|
|
60
|
+
*/
|
|
61
|
+
getObject<T>(key: string, defaultValue: T): Promise<StorageResult<T>>;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Set object in storage (alias for setItem for backward compatibility)
|
|
65
|
+
* @deprecated Use setItem instead
|
|
66
|
+
*/
|
|
67
|
+
setObject<T>(key: string, value: T): Promise<StorageResult<T>>;
|
|
56
68
|
}
|
|
@@ -143,6 +143,22 @@ export class AsyncStorageRepository implements IStorageRepository {
|
|
|
143
143
|
return failure(new StorageReadError('MULTIPLE_KEYS', error));
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Get object from storage (alias for getItem for backward compatibility)
|
|
149
|
+
* @deprecated Use getItem instead
|
|
150
|
+
*/
|
|
151
|
+
async getObject<T>(key: string, defaultValue: T): Promise<StorageResult<T>> {
|
|
152
|
+
return this.getItem(key, defaultValue);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Set object in storage (alias for setItem for backward compatibility)
|
|
157
|
+
* @deprecated Use setItem instead
|
|
158
|
+
*/
|
|
159
|
+
async setObject<T>(key: string, value: T): Promise<StorageResult<T>> {
|
|
160
|
+
return this.setItem(key, value);
|
|
161
|
+
}
|
|
146
162
|
}
|
|
147
163
|
|
|
148
164
|
/**
|