Skip to content

Commit

Permalink
Merge pull request #412 from smartprocure/asyncfix
Browse files Browse the repository at this point in the history
Bugfix :)
  • Loading branch information
daedalus28 committed Mar 26, 2023
2 parents 8ac68f9 + 5e98f61 commit 2adb962
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
5 changes: 4 additions & 1 deletion src/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 2adb962

Please sign in to comment.