Fork me on GitHub
#cljsrn
<
2022-04-29
>
diego.videco17:04:56

Hello everyone, got an issue on an expo app while using js/Promise.all . The problems is that on production mode (run with expo start --no-dev --minify) seems like Promise.all just passes an empty vector to then (or so it seems). Here’s an example:

(def sum (atom 0))
(-> sum)
(.. (js/Promise.all (mapv js/Promise.resolve [1 2 3 4]))
    (then #(reset! sum (apply + %))))
Can anyone reproduce this issue and if so, any ideas regarding why this might be happening. It works fine in dev mode.

diego.videco18:04:38

Just found out that this fixes the issue:

(.. (js/Promise.all (apply array (mapv js/Promise.resolve [1 2 3 4])))
    (then #(reset! sum (apply + %))))

👍 1