How to use the pinkie.all function in pinkie

To help you get started, we’ve selected a few pinkie 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 DevExpress / testcafe / src / utils / parse-ssl-options.js View on Github external
export default async function (optionsStr = '') {
    const splittedOptions = optionsStr.split(OPTIONS_SEPARATOR);

    if (!splittedOptions.length)
        return null;

    const parsedOptions = {};

    await Promise.all(splittedOptions.map(async item => {
        const keyValuePair = item.split(OPTION_KEY_VALUE_SEPARATOR);
        const key          = keyValuePair[0];
        let value          = keyValuePair[1];

        if (!key || !value)
            return;

        value = await ensureOptionValue(key, value);

        parsedOptions[key] = value;
    }));

    return parsedOptions;
}
github DevExpress / testcafe / src / browser / provider / built-in / saucelabs.js View on Github external
async function getAutomationApiInfo (automationApi) {
    var automationApiData = await getAssetData([automationApi]);

    var devicesData = await Promise.all(automationApiData.map(data => getDeviceData(automationApi, data)));

    automationApiData = automationApiData
        .map((data, index) => concatDeviceData(data, devicesData[index]))
        .filter(data => data.length);

    automationApiData = flatten(automationApiData);

    return automationApiData
        .map(data => formatAutomationApiData(automationApi, data))
        .filter(data => data);
}
github DevExpress / testcafe-hammerhead / src / client / sandbox / cookie / window-sync.ts View on Github external
return this._delegateSyncBetweenWindowsToTop(cookies);

        const windowsForSync = this._getWindowsForSync(initiator);
        const syncMessages   = [];

        for (const win of windowsForSync) {
            const cookieSandbox = WindowSync._getCookieSandbox(win);

            if (cookieSandbox)
                cookieSandbox.syncWindowCookie(cookies);
            else
                syncMessages.push(this._sendSyncMessage(win, SYNC_COOKIE_START_CMD, cookies));
        }

        if (syncMessages.length)
            Promise.all(syncMessages).then(() => this._removeSyncCookie(cookies));
        else
            this._removeSyncCookie(cookies);
    }
github DevExpress / testcafe-hammerhead / src / client / transport.ts View on Github external
batchUpdate (): Promise {
        const storedMessages = Transport._getStoredMessages();

        if (storedMessages.length) {
            const tasks = [];

            nativeMethods.winLocalStorageGetter.call(window).removeItem(settings.get().sessionId);

            for (const storedMessage of storedMessages)
                tasks.push(this.queuedAsyncServiceMsg(storedMessage));

            return Promise.all(tasks);
        }
        return Promise.resolve();
    }
github DevExpress / testcafe / src / browser / provider / built-in / saucelabs.js View on Github external
async _fetchPlatformInfoAndAliases () {
        var automationApiInfoPromises = AUTOMATION_APIS.map(automationApi => getAutomationApiInfo(automationApi));
        var platformsInfo             = await Promise.all(automationApiInfoPromises);

        this.platformsInfo = flatten(platformsInfo);

        var unstructuredBrowserNames = this.platformsInfo
            .map(platformInfo => this._createAliasesForPlatformInfo(platformInfo));

        this.availableBrowserNames = flatten(unstructuredBrowserNames);
    },
github dfilatov / vow / benchmarks / comparison.js View on Github external
var resolve,
                    promise = new Pinkie(function(_resolve) {
                        resolve = _resolve;
                    });
                Pinkie.all(data[key].map(function(val) {
                        return new Pinkie(function(_resolve) {
                            toResolve.push({ resolve : _resolve, val : val });
                        });
                    }))
                    .then(function(val) {
                        resolve(val);
                    });
                topPromises.push(promise);
            });

            Pinkie.all(topPromises).then(function() {
                deferred.resolve();
            });

            toResolve.forEach(function(obj) {
                obj.resolve(obj.val);
            });
        },
github dfilatov / vow / benchmarks / comparison.js View on Github external
Object.keys(data).forEach(function(key) {
                var resolve,
                    promise = new Pinkie(function(_resolve) {
                        resolve = _resolve;
                    });
                Pinkie.all(data[key].map(function(val) {
                        return new Pinkie(function(_resolve) {
                            toResolve.push({ resolve : _resolve, val : val });
                        });
                    }))
                    .then(function(val) {
                        resolve(val);
                    });
                topPromises.push(promise);
            });

pinkie

Itty bitty little widdle twinkie pinkie ES2015 Promise implementation

MIT
Latest version published 9 years ago

Package Health Score

67 / 100
Full package analysis