pecs icon indicating copy to clipboard operation
pecs copied to clipboard

QUESTION: Possible to chain list of promises sequentially sharing state

Open Semihazah opened this issue 2 years ago • 1 comments

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?

Semihazah avatar Aug 09 '23 01:08 Semihazah

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.

jkb0o avatar Aug 15 '23 16:08 jkb0o