How to use the zalgo-promise/src.ZalgoPromise.map function in zalgo-promise

To help you get started, we’ve selected a few zalgo-promise 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 / legacy / button.js View on Github external
export function renderButtons(id : string, buttons : Array) : ZalgoPromise> {

    return ZalgoPromise.map(buttons, button => {
        return ZalgoPromise.try(() => {

            if (button.container) {
                return renderButton(id, button);
            } else {
                return button.button;
            }

        }).then(element => {

            let container;
            let type;
            let condition = button.condition;
            let click     = button.click;

            if (button.container) {