How to use the zalgo-promise/src.ZalgoPromise.resolve 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-smart-payment-buttons / test / client / prerender.js View on Github external
            window.xprops.createOrder = mockAsyncProp(expect('createOrder', async () => ZalgoPromise.resolve(orderID)));
github paypal / paypal-smart-payment-buttons / test / client / prerender.js View on Github external
            window.xprops.onClick = mockAsyncProp(expect('onClick', () => ZalgoPromise.resolve()));
github paypal / paypal-smart-payment-buttons / test / client / happy.js View on Github external
            window.xprops.onClick = mockAsyncProp(expect('onClick', () => ZalgoPromise.resolve()));
github paypal / paypal-card-components / test / component.js View on Github external
      createOrder: () => ZalgoPromise.resolve('order-id'),
      onApprove:   td.function(),
github paypal / paypal-smart-payment-buttons / test / client / validation.js View on Github external
            window.xprops.onClick = mockAsyncProp(expect('onClick', () => ZalgoPromise.resolve()));
            window.xprops.createOrder = avoid('createOrder', () => ZalgoPromise.reject(new Error(`Avoid createOrder`)));
github krakenjs / zoid / src / lib / dom.js View on Github external
export function awaitFrameWindow(frame : HTMLIFrameElement) : ZalgoPromise {

    if (frame.contentWindow) {
        return ZalgoPromise.resolve(frame.contentWindow);
    }

    return awaitFrameLoad(frame).then(loadedFrame => {

        if (!loadedFrame.contentWindow) {
            throw new Error(`Could not find window in iframe`);
        }

        return loadedFrame.contentWindow;
    });
}
github paypal / paypal-checkout-components / src / lib / funding.js View on Github external
export function precacheRememberedFunding() : ZalgoPromise {
    if (!getSessionState(session => session.recentlyCheckedRemembered)) {
        return loadMeta();
    }
    return ZalgoPromise.resolve();
}
github paypal / paypal-checkout-components / src / legacy / interface.js View on Github external
    renderPayPalCheckout({ url, payment: () => ZalgoPromise.resolve(paymentToken) });
}
github krakenjs / zoid / src / lib / promise.js View on Github external
return function denodeifyWrapper() : ZalgoPromise {

        let self = this;
        let args = Array.prototype.slice.call(arguments);

        if (args.length >= method.length) {
            return ZalgoPromise.resolve(method.apply(self, args));
        }

        return new ZalgoPromise((resolve, reject) => {
            args.push((err, result) => {

                if (err && !(err instanceof Error)) {
                    throw new Error(`Passed non-Error object in callback: [ ${ err } ] -- callbacks should either be called with callback(new Error(...)) or callback(null, result).`);
                }

                return err ? reject(err) : resolve(result);
            });
            method.apply(self, args);
        });
    };
}
github paypal / paypal-checkout-components / src / checkout / popupBridge.js View on Github external
function ternary(condition, truthyResult, falsyResult) : ZalgoPromise<*> {
    return ZalgoPromise.resolve(condition).then(result => {
        return result ? truthyResult() : falsyResult();
    });
}