Projekt

Obecné

Profil

Stáhnout (302 Bajtů) Statistiky
| Větev: | Revize:
1
'use strict';
2
module.exports = (promise, onFinally) => {
3
	onFinally = onFinally || (() => {});
4

    
5
	return promise.then(
6
		val => new Promise(resolve => {
7
			resolve(onFinally());
8
		}).then(() => val),
9
		err => new Promise(resolve => {
10
			resolve(onFinally());
11
		}).then(() => {
12
			throw err;
13
		})
14
	);
15
};
(1-1/4)