When or who does pass resolve and reject functions to JS promises?

后端 未结 5 1615
无人共我
无人共我 2021-01-12 11:52

I have begin learning javascript promises. But I just can\'t understand the concept of promises. The thing that bothers me most is who is passing the Resolver and Reject fun

5条回答
  •  攒了一身酷
    2021-01-12 12:33

    The promise library creates and passes those functions, along with all the other metadata needed to track the promise and record completion, store state and progress, cancel it, etc.

    The folks behind Bluebird have published some info on how the library works internally, and you can see more in the Bluebird source.

提交回复
热议问题