You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if there was a way to run a series of promises sequentially, waiting for the previous one to finish, and return a vec of all promises for use with p/all. This is different to creating a map of promise returning functions as that would run in parallel not sequentially. See discussion on Slack here.
That is interesting, but after looking a referenced gist, I see a very different set of operations and each one has its own use cases and its own impl. Is not the same if you want collect the results (aka reduce-like) or just need to execute N number of tasks secuentially without collecting the result.
Can we elaborate a bit the real needed use case?
It would be great if there was a way to run a series of promises sequentially, waiting for the previous one to finish, and return a vec of all promises for use with
p/all
. This is different to creating a map of promise returning functions as that would run in parallel not sequentially. See discussion on Slack here.Here is an implementation using
reduce
:Here is an implementation using
p/loop
andp/recur
:You can test this in
nbb
withpromises.cljs
here:https://gist.github.com/chr15m/c5f943b6aa2c6089c04f04897b3cef81
The text was updated successfully, but these errors were encountered: