Closed ggcaponetto closed 2 years ago
Hi @ggcaponetto ! Just added "onStop" function that can be implemented in scripts. I just released v4.1.1 of the Editor that includes this enhancement
The onStop function is called on the component is disposed. Also, when editor stops, all components are disposed so the onStop function is called.
Thanks for that request :)
@julien-moreau It works. Thanks for adding this quickly.
Hello
I am new to BJS and am struggling understanding the lifecycles of a script attached to a Node.
Let's say I connect to websockts on the
public onStart()
. Where in the code am I supposed to close the connection when I press the stop button in the preview of the editor?Is there a lifecycle method like
onStop()/onDispose()/onEditorStop()
or something like that?The socket disconnects only if I run the project in the browser and I close it, but not in the preview of the editor.