theblitzapp / championgg-api-node

A node module wrapper for the Champion.GG API
MIT License
12 stars 1 forks source link

Promises support #4

Open Ilshidur opened 7 years ago

Ilshidur commented 7 years ago

Some support for A+ Promises would be nice.

Something like :

gg.statistics
  .overall()
  .then(function(data) {
    // ...
  })
  .catch(function(err) {
    // ...
  });

So we also can implement it with ES7 async :

async function getOverallDatas() {
  try {
    return await gg.statistics.overall();
  } catch (e) {
    console.warn('No data found !');
    return {};
  }
}

Anyway, thanks for the great API !

abaltra commented 7 years ago

While I completely agree that it would be a great feature, I can't really promise I'll be able to code it in the short-term, super busy atm. You are free to submit a PR for it though! :D

Ilshidur commented 5 years ago

Almost 2 years later, I made it \o/

=> https://github.com/theblitzapp/championgg-api-node/pull/5

andrewtian commented 5 years ago

sick

On Wed, Feb 20, 2019, at 18:20, Nicolas Coutin wrote:

Almost 2 years later, I made it \o/

=> #5 https://github.com/theblitzapp/championgg-api-node/pull/5

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/theblitzapp/championgg-api-node/issues/4#issuecomment-465795694, or mute the thread https://github.com/notifications/unsubscribe-auth/AFZ7hkx_b2LhIHc22jJmX46MhgHdipTvks5vPdhZgaJpZM4NaHwR.