src/rainbow.js
function _generateHandler(element, waitingOn, callback) {
    return function _handleResponseFromWorker(data) {
        element.innerHTML = data.result;
        element.classList.remove('loading');
        element.classList.add('rainbow-show');

        if (element.parentNode.tagName === 'PRE') {
            element.parentNode.classList.remove('loading');
            element.parentNode.classList.add('rainbow-show');
        }

        // element.addEventListener('animationend', (e) => {
        //     if (e.animationName === 'fade-in') {
        //         setTimeout(() => {
        //             element.classList.remove('decrease-delay');
        //         }, 1000);
        //     }
        // });

        if (onHighlightCallback) {
            onHighlightCallback(element, data.lang);
        }

        if (--waitingOn.c === 0) {
            callback();
        }
    };
}
function _generateHandler(element, waitingOn, callback) {
    return function _handleResponseFromWorker(data) {
        element.innerHTML = data.result;
        element.classList.remove('loading');
        element.classList.add('rainbow-show');

        if (element.parentNode.tagName === 'PRE') {
            element.parentNode.classList.remove('loading');
            element.parentNode.classList.add('rainbow-show');
        }

        // element.addEventListener('animationend', (e) => {
        //     if (e.animationName === 'fade-in') {
        //         setTimeout(() => {
        //             element.classList.remove('decrease-delay');
        //         }, 1000);
        //     }
        // });

        if (onHighlightCallback) {
            onHighlightCallback(element, data.lang);
        }

        if (--waitingOn.c === 0) {
            callback();
        }
    };
}
function _generateHandler ( element , waitingOn , callback ) { return function _handleResponseFromWorker ( data ) { element . innerHTML = data . result ; element . classList . remove ( 'loading' ) ; element . classList . add ( 'rainbow-show' ) ; if ( element . parentNode . tagName === 'PRE' ) { element . parentNode . classList . remove ( 'loading' ) ; element . parentNode . classList . add ( 'rainbow-show' ) ; } // element.addEventListener('animationend', (e) => { //     if (e.animationName === 'fade-in') { //         setTimeout(() => { //             element.classList.remove('decrease-delay'); //         }, 1000); //     } // }); if ( onHighlightCallback ) { onHighlightCallback ( element , data . lang ) ; } if ( -- waitingOn . c === 0 ) { callback ( ) ; } } ; }
Browser Only - Handles response from web worker, updates DOM with
resulting code, and fires callback

@param {Element} element
@param {object} waitingOn
@param {Function} callback
@return {void}
Browser Only - Handles response from web worker updates DOM with resulting code and fires callback