Skip to content

Commit 99c47ce

Browse files
committed
fix(core): fixes types for *async directive
1 parent f41937a commit 99c47ce

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

projects/platform/src/lib/directives/async.directive.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ export class AsyncDirective implements OnChanges, OnDestroy {
5959

6060
@Input() async: ObservableOrPromise<any>;
6161
@Input() asyncFrom: ObservableOrPromise<any>;
62-
@Input() asyncNext: any;
63-
@Input() asyncError: any;
64-
@Input() asyncComplete: any;
62+
@Input() asyncNext: (value: any) => void;
63+
@Input() asyncError: (error: any) => void;
64+
@Input() asyncComplete: () => void;
6565

6666
@Output() next: EventEmitter<any> = new EventEmitter<any>();
6767
@Output() error: EventEmitter<any> = new EventEmitter<any>();
@@ -108,8 +108,8 @@ export class AsyncDirective implements OnChanges, OnDestroy {
108108
this.subscription = this.strategy.createSubscription(
109109
async,
110110
(value: any) => this.onNext(value),
111-
(value: any) => this.onError(value),
112-
(value: any) => this.onComplete(value)
111+
(error: any) => this.onError(error),
112+
() => this.onComplete()
113113
);
114114
}
115115

@@ -122,17 +122,17 @@ export class AsyncDirective implements OnChanges, OnDestroy {
122122
this.viewRef.markForCheck();
123123
}
124124

125-
private onError(value: any): void {
126-
this.error.emit(value);
125+
private onError(error: any): void {
126+
this.error.emit(error);
127127
if (isFunction(this.asyncError)) {
128-
this.asyncError(value);
128+
this.asyncError(error);
129129
}
130130
}
131131

132-
private onComplete(value: any): void {
133-
this.complete.next(value);
132+
private onComplete(): void {
133+
this.complete.next();
134134
if (isFunction(this.asyncComplete)) {
135-
this.asyncComplete(value);
135+
this.asyncComplete();
136136
}
137137
}
138138

0 commit comments

Comments
 (0)