Twitchat
Twitchat copied to clipboard
PUBLIC_API.md - fixed example code
Fixed example code where the connect() function takes arguments but are not set in the call.
Also, removed the setTimeout() in case of connection error, since it won't return anyway.
As discussed on discord, i'd prefer to keep the connect params so the function remains context agnostic. But, I indeed forgot to give them on the connect() call, good catch !
Also, i'd prefer to keep the reconnect attempt process so we're sure the app connects to OBS even if OBS is started after. But as you saw, my promise system is broken and should be replaced by something like this:
async function connect(port:string, pass:string):Promise<void> {
return new Promise((resove, reject)=> {
try { /*...*/ }
catch(error) {
//....
return;
}
//...
resolve();
})
}
Thank you for your feedback :) !