whatadewitt / yahoo-fantasy-sports-api

NodeJS wrapper for the Yahoo! Fantasy Sports API
https://yahoo-fantasy-node-docs.vercel.app/
MIT License
192 stars 52 forks source link

Return promises from calling resources while still invoking callbacks if provided #44

Closed ryus08 closed 5 years ago

ryus08 commented 6 years ago

Resolves https://github.com/whatadewitt/yfsapi/issues/41

ryus08 commented 6 years ago

Tests do pass with the changes from https://github.com/whatadewitt/yfsapi/pull/42 merged in

ryus08 commented 6 years ago

There are a lot of changes here, largely because every function needs to return something with this change.

Most of the changes followed a similar pattern, I'll try to describe that pattern inline

ryus08 commented 6 years ago

I realized after I went to bed last night that this definitely needs some work. I'm calling the callback with the value/error for every method, but not returning/throwing it for the promise to return it. I also need to write some tests to actually assert that I am doing so.

So consider this a first pass to show some of the patterns, but it still needs work.

whatadewitt commented 6 years ago

Maaaan I'm SO sorry. This all looks great (from what I've skimmed), I'm just slammed this week. I plan to take some time this weekend to get this merged in. Thank you so much!

ryus08 commented 6 years ago

No worries and no rush at all! I've still got a bit to do and some to test.