Last active
January 22, 2022 19:40
-
-
Save Cst2989/a117597d8d085cd3739d839881fa9912 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
await AsyncStorage.setItem('@token', result.data.token); | |
const jsonValue = JSON.stringify(result.data); | |
await AsyncStorage.setItem('@user_Object', jsonValue); | |
} catch (e) { | |
console.log(e); | |
} | |
try { | |
const value = await AsyncStorage.getItem('@user_Object'); | |
if (value !== null) { | |
const userObjectParsed = JSON.parse(value); | |
} | |
} catch (e) { | |
// error reading value | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment