Html Editor Widget event

Hi

I'm using the following code to load Wiki content in Smart View.

It kind of works, but I have doubts about fetch().done method. I need to be able to know when the full content of wiki is loaded so I can run another function GetAllWikiHTML.

In some cases GetAllWikiHTML does not have all the wiki content.

Are there other ways to make sure wiki content is fully loaded? and how to get it.

Here is the current code

    const WikiDataID = 222222;
        
    var modulesToLoad1 = ['csui/lib/marionette','csui/utils/contexts/page/page.context','csui/widgets/html.editor/html.editor.view',"csui/utils/contexts/factories/connector" ];
    
    if (csui.onReady3) {
        csui.onReady3({ connection: serverConnection },modulesToLoad1, ShowWidget, handleError);
    }
    
    function ShowWidget(Marionette, PageContext, HtmlEditorView,ConnectorFactory)
    {
     
        var pageContext = new PageContext(),
                connector = pageContext.getObject(ConnectorFactory);

            connector.authenticator.updateAuthenticatedSession({
                ticket: xxxxxx
            });   
        
        
        var htmlEditorView = new HtmlEditorView({
            title:false,
            context: pageContext,
            id: WikiDataID 
        
          }),
          
          htmlEditorRegion = new Marionette.Region({
            el: "#wikicontent"
          });
          
        htmlEditorRegion.show(htmlEditorView);
        
        pageContext.fetch().done(function() {
            console.log("Wiki content fully loaded ???? ");
            GetAllWikiHTML();
        });

    }

Thanks

Uldis