spotify / web-playback-sdk

This issue tracker is no longer used. Join us in the Spotify for Developers forum for support with the Spotify Web Playback SDK ➡️ https://community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer
106 stars 7 forks source link

Spotify.Player#connect: reject/resolve instead of success arg? #15

Open paulgoetze opened 6 years ago

paulgoetze commented 6 years ago

Issue found on 21/02/2018.

Is there any reason for passing a success argument to the resolved-handler of Spotify.Player#connect? Wouldn’t it make more sense to just resolve or reject the promise returned by Spotify.Player#connect instead of passing a success boolean? (See https://beta.developer.spotify.com/documentation/web-playback-sdk/reference/#api-spotify-player-connect)

A related question: What is the reason for having the ready event instead of passing the respective data to the resolved-handler of Spotify.Player#connect (.then(data))?

Expected behaviour:

Actual behaviour:

NeoLegends commented 6 years ago

The current flow requires you to examine the output of the initialization_failed event handler, if success is false. This is strange but probably why its there. I would also be in favor of removing that event and reporting initialization success directly through the promise.

bih commented 6 years ago

@paulgoetze @NeoLegends This is great feedback. We'll take it on board and we'll be sure to post it here if there's any updates related to this :)