Skip to content

async/await support #46

Description

@Erfa

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)
          }
        });
     }
   );
  }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions