mg-library 1.0.286 → 1.0.287
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/functions.js +26 -3
- package/package.json +1 -1
package/functions.js
CHANGED
|
@@ -173,13 +173,36 @@ export function getTimeForExposition(date) {
|
|
|
173
173
|
|
|
174
174
|
// Local Storage
|
|
175
175
|
|
|
176
|
-
export async
|
|
176
|
+
export const writeToLocalStorage = async (key,value) => {
|
|
177
|
+
try {
|
|
178
|
+
await AsyncStorage.setItem(key, value);
|
|
179
|
+
} catch (e) {
|
|
180
|
+
console.log('Escribiendo');
|
|
181
|
+
console.log(e);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
export const readFromLocalStorage = async (key) => {
|
|
186
|
+
try {
|
|
187
|
+
const value = await AsyncStorage.getItem(key);
|
|
188
|
+
if (value !== null) {
|
|
189
|
+
console.log('Recuperado');
|
|
190
|
+
console.log(value);
|
|
191
|
+
}
|
|
192
|
+
} catch (e) {
|
|
193
|
+
console.log('Leyendo');
|
|
194
|
+
console.log(e);
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
/* export async function writeToLocalStorage(key, value) {
|
|
177
200
|
try {
|
|
178
201
|
await AsyncStorage.setItem(key,value);
|
|
179
202
|
} catch (error) {
|
|
180
203
|
console.log('WRITING');
|
|
181
204
|
console.log(error);
|
|
182
|
-
}
|
|
205
|
+
}
|
|
183
206
|
}
|
|
184
207
|
|
|
185
208
|
export async function readFromLocalStorage(key) {ç
|
|
@@ -189,4 +212,4 @@ export async function readFromLocalStorage(key) {ç
|
|
|
189
212
|
console.log('READING');
|
|
190
213
|
console.log(error);
|
|
191
214
|
}
|
|
192
|
-
}
|
|
215
|
+
} */
|