Skip to content

async/await support #46

@Erfa

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

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