iink SDK Web

Answered

Listener for when myscript has connected to websocket

 Is there a callback or listener I can attach to when the `editor` is loaded & connected to the websocket?


I'm trying to call export on the editor but it's failing... I wanna know the right timing to do this.


Best Answer

Dear Robert,


thank you for contacting us.


Currenly, there is no listener on the editor. Nevertheless, before calling the "export" function, we recommend you ensure the editor is in idle state. The easier is that you call the "waitForIdle" function: https://myscript.github.io/MyScriptJS/docs/class/src/Editor.js~Editor.html#instance-method-waitForIdle


Best regards,


Olivier

1 Comment

Answer

Dear Robert,


thank you for contacting us.


Currenly, there is no listener on the editor. Nevertheless, before calling the "export" function, we recommend you ensure the editor is in idle state. The easier is that you call the "waitForIdle" function: https://myscript.github.io/MyScriptJS/docs/class/src/Editor.js~Editor.html#instance-method-waitForIdle


Best regards,


Olivier