Created
          May 2, 2019 20:00 
        
      - 
      
- 
        Save alexalannunes/fe5a499abf77a2a163600f1bde609a64 to your computer and use it in GitHub Desktop. 
    function async/await using callback
  
        
  
    
      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
    
  
  
    
  | class GitHubUser { | |
| async data(cb) { | |
| let users = await $.get('http://api.github.com/users/alexalannunes'); | |
| cb(users); | |
| } | |
| } | |
| var user = new GitHubUser(); | |
| user.data(users => { | |
| console.log(users); | |
| }); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment