Skip to content

how can we chain promise together #3

Description

@takaaptech

I found lua_promise is awesome lib. The "when" and "done" functions are very clear and easy to use, but how can i chain some promise together? For example, i need some code like this:

promise1 = Promise:new()
promise2 = Promise:new()
promise3 = Promise:new()

promise1:andThen(promise2):andThen(promise3):done()

So when we call promise1:resolve(), it will go next and wait for promise2:resolve() and then wait for promise3:resolve() and finally it call done ?

Thank so much for nice promise lib!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions