File tree 1 file changed +2
-10
lines changed
1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -13,19 +13,11 @@ export class DeferredPromise<T> extends Promise<T> {
13
13
executor : ( resolve : ( value : T ) => void , reject : ( reason : Error ) => void ) => void ,
14
14
{ timeout, onTimeout } : DeferredPromiseOptions < T > = { }
15
15
) {
16
- let resolveFn : ( value : T ) => void ;
17
- let rejectFn : ( reason ?: unknown ) => void ;
18
-
19
16
super ( ( resolve , reject ) => {
20
- resolveFn = resolve ;
21
- rejectFn = reject ;
17
+ this . resolve = resolve ;
18
+ this . reject = reject ;
22
19
} ) ;
23
20
24
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
25
- this . resolve = resolveFn ! ;
26
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
27
- this . reject = rejectFn ! ;
28
-
29
21
if ( timeout !== undefined && onTimeout ) {
30
22
this . timeoutId = setTimeout ( ( ) => {
31
23
onTimeout ( this . resolve , this . reject ) ;
You can’t perform that action at this time.
0 commit comments