Guest User

Untitled

a guest
Jan 10th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. async function getStoredDatas(){
  2. try{
  3. return {
  4. user: await AsyncStorage.getItem('@Store:user'),
  5. password: await AsyncStorage.getItem('@Store:password')
  6. };
  7. }
  8. catch(e){
  9. console.log("error:" + e); // never triggered
  10. }
  11. }
  12.  
  13. let a = getStoredDatas().then( (datas) => {
  14. console.log("then: " + datas.user); // never triggered also
  15. });
  16.  
  17. console.log(a); // Promise with this content: {_40: 0, _65: 0, _55: null, _72: null}
Add Comment
Please, Sign In to add comment