How to use the belter/src.inlineMemoize function in belter

To help you get started, we’ve selected a few belter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github paypal / paypal-checkout-components / src / zoid / card-fields / component.js View on Github external
export function getCardFieldsComponent() : ZoidComponent {
    return inlineMemoize(getCardFieldsComponent, () => {
        // $FlowFixMe
        return create({
            tag:  'card-fields',
            name: 'ppcard',

            url: getCardUrl,

            dimensions: {
                height: '300px',
                width:  '100%'
            },

            attributes: {
                iframe: {
                    allowpaymentrequest: 'allowpaymentrequest',
                    scrolling:           'no'
github krakenjs / zoid / src / child / window.js View on Github external
function parseChildWindowName(windowName : string) : ChildPayload {
    return inlineMemoize(parseChildWindowName, () => {
        if (!windowName) {
            throw new Error(`No window name`);
        }
    
        const [ , zoidcomp, name, encodedPayload ] = windowName.split('__');
    
        if (zoidcomp !== ZOID) {
            throw new Error(`Window not rendered by zoid - got ${ zoidcomp }`);
        }
    
        if (!name) {
            throw new Error(`Expected component name`);
        }
    
        if (!encodedPayload) {
            throw new Error(`Expected encoded payload`);
github paypal / paypal-smart-payment-buttons / src / lib / logger.js View on Github external
export function getLogger() : LoggerType {
    return inlineMemoize(getLogger, () =>
        Logger({
            url: LOGGER_URL
        }));
}
github paypal / paypal-sdk-client / dist / module / logger.js View on Github external
export function getLogger() {
    return inlineMemoize(getLogger, function () {
        return Logger({
            url: getPayPalLoggerUrl()
        });
    });
}
github paypal / paypal-sdk-client / src / script.js View on Github external
export function getSDKAttributes() : { [string] : string } {
    return inlineMemoize(getSDKAttributes, () => {
        const sdkScript = getSDKScript();
        const result = {};
        for (const attr of sdkScript.attributes) {
            if (attr.name.indexOf('data-') === 0) {
                result[attr.name] = attr.value;
            }
        }
        return result;
    });
}
github paypal / paypal-checkout-components / src / funding / config.js View on Github external
export function getFundingConfig() : { [$Values] : ?FundingSourceConfig } {
    return inlineMemoize(getFundingConfig, () => {
        return {
            [ FUNDING.PAYPAL ]:         (!__TREE_SHAKE__ || (__paypal_checkout__.serverConfig.fundingEligibility.paypal         && __paypal_checkout__.serverConfig.fundingEligibility.paypal.eligible)) ? getPayPalConfig() : null,
            [ FUNDING.VENMO ]:          (!__TREE_SHAKE__ || (__paypal_checkout__.serverConfig.fundingEligibility.venmo          && __paypal_checkout__.serverConfig.fundingEligibility.venmo.eligible)) ? getVenmoConfig() : null,
            [ FUNDING.ITAU ]:           (!__TREE_SHAKE__ || (__paypal_checkout__.serverConfig.fundingEligibility.itau           && __paypal_checkout__.serverConfig.fundingEligibility.itau.eligible)) ? getItauConfig() : null,
            [ FUNDING.CREDIT ]:         (!__TREE_SHAKE__ || (__paypal_checkout__.serverConfig.fundingEligibility.credit         && __paypal_checkout__.serverConfig.fundingEligibility.credit.eligible)) ? getCreditConfig() : null,
            [ FUNDING.CARD ]:           (!__TREE_SHAKE__ || (__paypal_checkout__.serverConfig.fundingEligibility.card           && __paypal_checkout__.serverConfig.fundingEligibility.card.eligible)) ? getCardConfig() : null,
            [ FUNDING.IDEAL ]:          (!__TREE_SHAKE__ || (__paypal_checkout__.serverConfig.fundingEligibility.ideal          && __paypal_checkout__.serverConfig.fundingEligibility.ideal.eligible)) ? getIdealConfig() : null,
            [ FUNDING.SEPA ]:           (!__TREE_SHAKE__ || (__paypal_checkout__.serverConfig.fundingEligibility.sepa           && __paypal_checkout__.serverConfig.fundingEligibility.sepa.eligible)) ? getSepaConfig() : null,
            [ FUNDING.BANCONTACT ]:     (!__TREE_SHAKE__ || (__paypal_checkout__.serverConfig.fundingEligibility.bancontact     && __paypal_checkout__.serverConfig.fundingEligibility.bancontact.eligible)) ? getBancontactConfig() : null,
            [ FUNDING.GIROPAY ]:        (!__TREE_SHAKE__ || (__paypal_checkout__.serverConfig.fundingEligibility.giropay        && __paypal_checkout__.serverConfig.fundingEligibility.giropay.eligible)) ? getGiropayConfig() : null,
            [ FUNDING.SOFORT ]:         (!__TREE_SHAKE__ || (__paypal_checkout__.serverConfig.fundingEligibility.sofort         && __paypal_checkout__.serverConfig.fundingEligibility.sofort.eligible)) ? getSofortConfig() : null,
            [ FUNDING.EPS ]:            (!__TREE_SHAKE__ || (__paypal_checkout__.serverConfig.fundingEligibility.eps            && __paypal_checkout__.serverConfig.fundingEligibility.eps.eligible)) ? getEpsConfig() : null,
            [ FUNDING.MYBANK ]:         (!__TREE_SHAKE__ || (__paypal_checkout__.serverConfig.fundingEligibility.mybank         && __paypal_checkout__.serverConfig.fundingEligibility.mybank.eligible)) ? getMybankConfig() : null,
            [ FUNDING.P24 ]:            (!__TREE_SHAKE__ || (__paypal_checkout__.serverConfig.fundingEligibility.p24            && __paypal_checkout__.serverConfig.fundingEligibility.p24.eligible)) ? getP24Config() : null,
            [ FUNDING.PAYU ]:           (!__TREE_SHAKE__ || (__paypal_checkout__.serverConfig.fundingEligibility.payu           && __paypal_checkout__.serverConfig.fundingEligibility.payu.eligible)) ? getPayuConfig() : null,
            [ FUNDING.VERKKOPANKKI ]:   (!__TREE_SHAKE__ || (__paypal_checkout__.serverConfig.fundingEligibility.verkkopankki   && __paypal_checkout__.serverConfig.fundingEligibility.verkkopankki.eligible)) ? getVerkkopankkiConfig() : null,
github paypal / paypal-sdk-client / dist / module / script.js View on Github external
export function getSDKScript() {
    return inlineMemoize(getSDKScript, function () {
        var _host$path = { host: getHost(), path: getPath() },
            host = _host$path.host,
            path = _host$path.path;

        var script = getScript({ host: host, path: path });

        if (!script) {
            throw new Error('PayPal Payments SDK script not present on page! Excected to find 
github paypal / paypal-sdk-client / src / logger.js View on Github external
export function getLogger() : LoggerType {
    return inlineMemoize(getLogger, () =>
        Logger({
            url: getPayPalLoggerUrl()
        }));
}