Closed ITz-Viks closed 1 year ago
This adds an optional on_success parameter that takes a function or a coroutine, to RustWebSocket, RustRemote and BaseRustSocket.
The provided function or a coroutine will be executed when the connection has been successfully established.
To explain this code:
try: self.on_success() except TypeError: pass
The try and except is used to prevent a TypeError NoneType is not callable error. This occurs when the user doesn't provide any on_success function
TypeError NoneType is not callable error
I think I did it lol i'm not sure how to use the UI for revisions
Thanks
This adds an optional on_success parameter that takes a function or a coroutine, to RustWebSocket, RustRemote and BaseRustSocket.
The provided function or a coroutine will be executed when the connection has been successfully established.
To explain this code:
The try and except is used to prevent a
TypeError NoneType is not callable error
. This occurs when the user doesn't provide any on_success function