ionorg / ion-sdk-js

ion javascript sdk
MIT License
102 stars 69 forks source link

Resolve `join` promise after API channel ready (2) #192

Closed kevinmcconnell closed 3 years ago

kevinmcconnell commented 3 years ago

Previously, the (implicit) promise returned by join would resolve after establishing the transports, but before the API data channel was attached. This meant there was a small window of time where the API data channel was not ready, and trying to use the subscriber API during that time would fail silently.

This change returns a promise that does not resolve until after the API channel is established.

Note: this is an update to #185, to include a fix to make it work correctly with src/ion.ts.