Created
August 4, 2018 22:24
-
-
Save minmaxdata/7cc718e2ee7893fff1a7955887aeaedd to your computer and use it in GitHub Desktop.
Await Async Example
This file contains hidden or 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
loadFlashCards = async () => { | |
const value = await AsyncStorage.getItem('flashcards'); | |
if (value !== null){ | |
this.setState({ | |
flashcards: JSON.parse(value) | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment