Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

async/await support #46

Open
Erfa opened this issue Dec 17, 2019 · 0 comments
Open

async/await support #46

Erfa opened this issue Dec 17, 2019 · 0 comments

Comments

@Erfa
Copy link

Erfa commented Dec 17, 2019

Does this wrapper support the async/await pattern? I tried it, but it doesn't seem like so. I ended up creating a small layer around it to solve it, like this:

export const challongeApi = {
  createTournament: async (tournament): => {
    return new Promise(
      (resolve, reject) => {
        client.tournaments.create({
          tournament: tournament,
          callback: (err, data) => {
            if (err)
              reject(err)
            else
              resolve(data)
          }
        });
     }
   );
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant