I am having trouble finding the right syntax / sample to only trigger the 
async callback I have registered once the swagger document has finish 
loading in the browser.

Right now, the code is being called twice, once when the swagger is 
starting loading and once when the it has completed.

here is my current test code, which does not work...

function HandleChangeSpecPlugin(system) {
    return {
        statePlugins: {
            spec: {
                wrapActions: {
                    updateUrl: function updateUrl(oriAction, system) {
                        return function (url) {
                            if (self.swaggerUi) {
                                console.log("status: "
                                            + 
self.swaggerUi.specActions.updateLoadingStatus());
                            }

// more custom code goes here ...
                            return oriAction(url);
                        };
                    }
                }
            }
        }
    };
}


I can put a breakpoint on download-url.js and watch the value changing on 
'payload', but cannot 

figure out the correct way to access the value and only process the event when 
status is "success"...


    updateLoadingStatus: (status) => {
      let enums = [null, "loading", "failed", "success", "failedConfig"]
      if(enums.indexOf(status) === -1) {
        console.error(`Error: ${status} is not one of ${JSON.stringify(enums)}`)
      }

      return {
        type: "spec_update_loading_status",
>>        payload: status
      }
    }

-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to