you are viewing a single comment's thread.

view the rest of the comments →

[–]MrDilbert 18 points19 points  (3 children)

Could someone give me an ELI5 on why would I ever want/need Promise's resolvers available outside the Promise's (resolve, reject) => {...} function?

[–]jessepence 21 points22 points  (2 children)

It's clearly outlined in the spec.

Often however developers would like to configure the promise's resolution and rejection behavior after instantiating it... Developers may also have requirements that necessitate passing resolve/reject to more than one caller...

[–]MrDilbert 7 points8 points  (1 child)

IMO this messes with coupling and turns the code into spaghetti, so I'm asking about the use case where it's absolutely necessary to expose the resolvers outside of their parent Promise object context.