@@ -6,42 +6,40 @@ const helpers = require('../../../build/helpers.js');
6
6
* @memberof helpers
7
7
* @constructor Deferred
8
8
*/
9
- class Deferred {
10
- constructor ( ) {
11
- /**
12
- * A method to resolve the associate Promise with the value passed.
13
- * @method resolve
14
- * @memberof helpers.Deferred
15
- * @instance
16
- * @param {* } value - the value to resolve the promise with
17
- */
18
- this . resolve = null ;
9
+ function Deferred ( ) {
10
+ /**
11
+ * A method to resolve the associate Promise with the value passed.
12
+ * @method resolve
13
+ * @memberof helpers.Deferred
14
+ * @instance
15
+ * @param {* } value - the value to resolve the promise with
16
+ */
17
+ this . resolve = null ;
19
18
20
- /**
21
- * A method to reject the associated Promise with the value passed.
22
- * If the promise is already settled it does nothing.
23
- * @method reject
24
- * @memberof helpers.Deferred
25
- * @instance
26
- * @param {* } reason - The reason for the rejection of the Promise.
27
- * Generally its an Error object. If however a Promise is passed, then the Promise
28
- * itself will be the reason for rejection no matter the state of the Promise.
29
- */
30
- this . reject = null ;
19
+ /**
20
+ * A method to reject the associated Promise with the value passed.
21
+ * If the promise is already settled it does nothing.
22
+ * @method reject
23
+ * @memberof helpers.Deferred
24
+ * @instance
25
+ * @param {* } reason - The reason for the rejection of the Promise.
26
+ * Generally its an Error object. If however a Promise is passed, then the Promise
27
+ * itself will be the reason for rejection no matter the state of the Promise.
28
+ */
29
+ this . reject = null ;
31
30
32
- /**
33
- * A newly created Promise object.
34
- * Initially in pending state.
35
- * @memberof helpers.Deferred
36
- * @member {Promise} promise
37
- * @instance
38
- */
39
- this . promise = new Promise ( ( resolve , reject ) => {
40
- this . resolve = resolve ;
41
- this . reject = reject ;
42
- } ) ;
43
- Object . freeze ( this ) ;
44
- }
31
+ /**
32
+ * A newly created Promise object.
33
+ * Initially in pending state.
34
+ * @memberof helpers.Deferred
35
+ * @member {Promise} promise
36
+ * @instance
37
+ */
38
+ this . promise = new Promise ( ( resolve , reject ) => {
39
+ this . resolve = resolve ;
40
+ this . reject = reject ;
41
+ } ) ;
42
+ Object . freeze ( this ) ;
45
43
}
46
44
47
45
/**
0 commit comments