src/initialize-mimetic-partial.js
function initalizeMimeticFinal(config) {
        // Destructured API parameters.
        const {
            scaleDelay,
        } = config;


        // Store the scaleDelay for kill and revive.
        resize.scaleDelay = scaleDelay;


        // The intial root font size.
        const rootFontSize = getRootREMValue(document);


        // // mobileWidth in pixels.
        // const mobileWidthPX = CSSUnitsToPixels(mobileWidth);


        // Cut off width in pixels.
        // const cutOffWidthPX = CSSUnitsToPixels(cutOffWidth);


        // Provide parameters to setRootFontSize. @TODO remove config, only use what is needed.
        const settings = Object.assign({
            initialOuterHeight: window.outerHeight,
            initialOuterWidth: window.outerWidth,
            rootFontSize,
            // mobileWidthPX,
            // cutOffWidthPX,
        }, config);


        // Store the settings for kill and revive.
        resize.settings = settings;


        // Immediately set the root font size according to MIMETIC.
        const setRootFontSizeScope = () => setRootFontSize(settings);
        resize.setRootFontSizeScope = setRootFontSizeScope;
        setRootFontSizeScope();


        // On window resize set the root font size according to MIMETIC.
        resize.resizilla = resizilla(() => {
            setRootFontSize(settings, setRootFontSizeScope);
        }, scaleDelay, false);
    }
function initalizeMimeticFinal(config) {
        // Destructured API parameters.
        const {
            scaleDelay,
        } = config;


        // Store the scaleDelay for kill and revive.
        resize.scaleDelay = scaleDelay;


        // The intial root font size.
        const rootFontSize = getRootREMValue(document);


        // // mobileWidth in pixels.
        // const mobileWidthPX = CSSUnitsToPixels(mobileWidth);


        // Cut off width in pixels.
        // const cutOffWidthPX = CSSUnitsToPixels(cutOffWidth);


        // Provide parameters to setRootFontSize. @TODO remove config, only use what is needed.
        const settings = Object.assign({
            initialOuterHeight: window.outerHeight,
            initialOuterWidth: window.outerWidth,
            rootFontSize,
            // mobileWidthPX,
            // cutOffWidthPX,
        }, config);


        // Store the settings for kill and revive.
        resize.settings = settings;


        // Immediately set the root font size according to MIMETIC.
        const setRootFontSizeScope = () => setRootFontSize(settings);
        resize.setRootFontSizeScope = setRootFontSizeScope;
        setRootFontSizeScope();


        // On window resize set the root font size according to MIMETIC.
        resize.resizilla = resizilla(() => {
            setRootFontSize(settings, setRootFontSizeScope);
        }, scaleDelay, false);
    }
function initalizeMimeticFinal ( config ) { // Destructured API parameters. const { scaleDelay , } = config ; // Store the scaleDelay for kill and revive. resize . scaleDelay = scaleDelay ; // The intial root font size. const rootFontSize = getRootREMValue ( document ) ; // // mobileWidth in pixels. // const mobileWidthPX = CSSUnitsToPixels(mobileWidth); // Cut off width in pixels. // const cutOffWidthPX = CSSUnitsToPixels(cutOffWidth); // Provide parameters to setRootFontSize. @TODO remove config, only use what is needed. const settings = Object . assign ( { initialOuterHeight : window . outerHeight , initialOuterWidth : window . outerWidth , rootFontSize , // mobileWidthPX, // cutOffWidthPX, } , config ) ; // Store the settings for kill and revive. resize . settings = settings ; // Immediately set the root font size according to MIMETIC. const setRootFontSizeScope = ( ) => setRootFontSize ( settings ) ; resize . setRootFontSizeScope = setRootFontSizeScope ; setRootFontSizeScope ( ) ; // On window resize set the root font size according to MIMETIC. resize . resizilla = resizilla ( ( ) => { setRootFontSize ( settings , setRootFontSizeScope ) ; } , scaleDelay , false ) ; }
The intializeMimetic function.
@param {object} config - The API parameters.
The intializeMimetic function .