Skip to content

Commit 46eaea0

Browse files
Zhenggang Sufengtianze
Zhenggang Su
authored andcommitted
fix: instanceof Observable always fail
1 parent e9eca03 commit 46eaea0

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/popular-bees-invent.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@alauda/ui": patch
3+
---
4+
5+
instanceof observable always fail

src/dialog/confirm-dialog/confirm-dialog.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
Component,
1111
ViewEncapsulation,
1212
} from '@angular/core';
13-
import { firstValueFrom, Observable } from 'rxjs';
13+
import { firstValueFrom, isObservable } from 'rxjs';
1414

1515
import { ButtonComponent } from '../../button/button.component';
1616
import { IconComponent } from '../../icon/icon.component';
@@ -113,7 +113,7 @@ export class ConfirmDialogComponent<T = unknown, R = unknown> {
113113

114114
const result = (beforeAction as CustomBeforeAction<T>)();
115115

116-
if (result instanceof Observable) {
116+
if (isObservable(result)) {
117117
return firstValueFrom(result);
118118
}
119119

0 commit comments

Comments
 (0)