jkb0o / pecs

Asynchronous operations for Bevy Engine
Apache License 2.0
64 stars 7 forks source link

QUESTION: Possible to chain list of promises sequentially sharing state #8

Open Semihazah opened 1 year ago

Semihazah commented 1 year ago

I'm trying to convert a list of Promise<State, ()> into a single promise that executes them in order and passes the state onto the next one. I don't know how many promises there will be, though, so I can't use then(). Is this possible?

jkb0o commented 1 year ago

I do not think this is possible right now out of the box.

It would be nice to have a chain() method that that can do exactly what you want.

I will dive into it.