Function
fin
(promise, finalPromiseFactory)
Source from the content-addressed store, hash-verified
| 7872 | |
| 7873 | // Promise finally util similar to Q.finally |
| 7874 | function fin(promise, finalPromiseFactory) { |
| 7875 | return promise.then(function (res) { |
| 7876 | return finalPromiseFactory().then(function () { |
| 7877 | return res; |
| 7878 | }); |
| 7879 | }, function (reason) { |
| 7880 | return finalPromiseFactory().then(function () { |
| 7881 | throw reason; |
| 7882 | }); |
| 7883 | }); |
| 7884 | } |
| 7885 | |
| 7886 | function sequentialize(queue, promiseFactory) { |
| 7887 | return function () { |
Tested by
no test coverage detected