How to use the zalgo-promise.ZalgoPromise.delay 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 / mocks.js View on Github external
    return (...args) => ZalgoPromise.delay(time).then(() => handler(...args));
}
github paypal / paypal-smart-payment-buttons / test / client / mocks.js View on Github external
done: async () => {
                firebaseDone();

                if (waitingForResponse.length) {
                    await ZalgoPromise.delay(0);
                }

                if (waitingForResponse.length) {
                    throw new Error(`Waiting for responses from firebase: ${  waitingForResponse.join(', ') }`);
                }
            }
        };
github paypal / paypal-smart-payment-buttons / test / client / mocks.js View on Github external
close: () => {
                    return ZalgoPromise.delay(50).then(() => {
                        if (props.onClose) {
                            return props.onClose();
                        }
                    });
                },
                onError: (err) => {
github paypal / paypal-smart-payment-buttons / test / client / mocks.js View on Github external
set location(loc : string) {
                ZalgoPromise.delay(10).then(() => {
                    currentUrl = loc;
                    onLoad();
                });
            },
            closed: false,