src/components/marker/marker.helper.js
function _memoizedComputeMarkerId() {
    let cache = {};

    return (highlight, transform, { maxZoom }) => {
        const cacheKey = `${highlight};${transform};${maxZoom}`;

        if (cache[cacheKey]) {
            return cache[cacheKey];
        }

        const markerId = _computeMarkerId(highlight, transform, { maxZoom });

        cache[cacheKey] = markerId;

        return markerId;
    };
}
function _memoizedComputeMarkerId() {
    let cache = {};

    return (highlight, transform, { maxZoom }) => {
        const cacheKey = `${highlight};${transform};${maxZoom}`;

        if (cache[cacheKey]) {
            return cache[cacheKey];
        }

        const markerId = _computeMarkerId(highlight, transform, { maxZoom });

        cache[cacheKey] = markerId;

        return markerId;
    };
}
function _memoizedComputeMarkerId ( ) { let cache = { } ; return ( highlight , transform , { maxZoom } ) => { const cacheKey = ` ${ highlight } ${ transform } ${ maxZoom } ` ; if ( cache [ cacheKey ] ) { return cache [ cacheKey ] ; } const markerId = _computeMarkerId ( highlight , transform , { maxZoom } ) ; cache [ cacheKey ] = markerId ; return markerId ; } ; }
This function memoize results for _computeMarkerId
since many of the times user will be playing around with the same zoom
factor, we can take advantage of this and cache the results for a
given combination of highlight state, zoom transform value and maxZoom config.
@returns{Function} memoize wrapper to the _computeMarkerId operation.
@memberof Marker/helper
This function memoize results for _computeMarkerId since many of the times user will be playing around with the same zoom factor we can take advantage of this and cache the results for a given combination of highlight state zoom transform value and maxZoom config .