Skip to content

PUBLIC_API.md - fixed example code#17

Open
xurei wants to merge 1 commit intoDurss:mainfrom
xurei:xurei-patch-1
Open

PUBLIC_API.md - fixed example code#17
xurei wants to merge 1 commit intoDurss:mainfrom
xurei:xurei-patch-1

Conversation

@xurei
Copy link

@xurei xurei commented Jul 29, 2022

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.

@Durss
Copy link
Owner

Durss commented Jul 31, 2022

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 :) !

@Durss Durss force-pushed the main branch 2 times, most recently from 665b0a6 to 699f4f1 Compare August 7, 2024 17:42
@Durss Durss force-pushed the main branch 2 times, most recently from 91b7ba7 to 6888aa4 Compare September 21, 2025 20:10
@Durss Durss force-pushed the main branch 2 times, most recently from f96cd21 to 9b593b3 Compare October 5, 2025 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments