src/page.js
function whenReady(funcToExecute) {
    if (isReady()) {
        logger.info('Page is already loaded, instantly executing!');
        funcToExecute();
        return;
    }

    logger.info('Waiting for page to be ready');
    callbacksOnReady.push(funcToExecute);
}
function whenReady(funcToExecute) {
    if (isReady()) {
        logger.info('Page is already loaded, instantly executing!');
        funcToExecute();
        return;
    }

    logger.info('Waiting for page to be ready');
    callbacksOnReady.push(funcToExecute);
}
function whenReady ( funcToExecute ) { if ( isReady ( ) ) { logger . info ( 'Page is already loaded, instantly executing!' ) ; funcToExecute ( ) ; return ; } logger . info ( 'Waiting for page to be ready' ) ; callbacksOnReady . push ( funcToExecute ) ; }
Returns a promise that resolves when the page is ready
@param funcToExecute - The function to execute when the page is loaded
Returns a promise that resolves when the page is ready