javascript - Accessing a previously fullfilled promise result in a promises chain -
this question has answer here: how access previous promise results in .then() chain? 15 answers what correct pattern, when coding promises, access data coming long before in chain of promises? for example: do_a.then(do_b).then(do_c).then(do_d).then(do_e_withthedatacomingfrom_a_and_c_onlywhen_d_issuccesfullycompleted) my current solution: passing along single json structure through chain, , let each step populate it. opinion that? i don't think there's 1 "correct" pattern this. solution sounds neat, however, it's bit tightly coupled. may work great situation, see few problems general pattern: participating steps need agree on structure of collector object. every step needs participate in @ least forwarding of object, can tedious if chain long , need previous data occurs sporadically. inflexible insertion of steps not written (c...