From 5e98f614fd42e866789fa13cf0340ee81ac583e6 Mon Sep 17 00:00:00 2001 From: Samuel Greene Date: Sat, 25 Mar 2023 23:39:39 -0700 Subject: [PATCH] Remove async/await in async `promiseProps` method to avoid downstream regeneratorRuntime issues --- CHANGELOG.md | 4 ++++ package-lock.json | 2 +- package.json | 2 +- src/async.js | 5 ++++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aad8376b..f47f1911 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.74.1 + +- Remove async/await in async `promiseProps` method to avoid downstream regeneratorRuntime issues + # 1.74.0 - Add `flowAsync` and `promiseProps` diff --git a/package-lock.json b/package-lock.json index 19614359..3e1feb27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "futil-js", - "version": "1.74.0", + "version": "1.74.1", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 460bf9f8..435e6e04 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "futil-js", - "version": "1.74.0", + "version": "1.74.1", "description": "F(unctional) util(ities). Resistance is futile.", "main": "lib/futil-js.js", "scripts": { diff --git a/src/async.js b/src/async.js index fe3cb028..8bccb5a7 100644 --- a/src/async.js +++ b/src/async.js @@ -8,7 +8,10 @@ import { resolveOnTree } from './tree' */ export let promiseProps = Promise.props || - (async (x) => _.zipObject(_.keys(x), await Promise.all(_.values(x)))) + ((x) => + Promise.all(_.values(x)).then((values) => _.zipObject(_.keys(x), values))) +// async/await still causes regeneratorRuntime issues downstream :( +// (async (x) => _.zipObject(_.keys(x), await Promise.all(_.values(x)))) // Calls then conditionally, allowing flow to be used synchronously, too let asyncCall = (value, f) => (value.then ? value.then(f) : f(value))