у меня следующий код
removeAlert() : Observable<boolean> {
Swal.fire({
title: 'delete this file ?',
text: 'sth',
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'ok',
cancelButtonText: 'cancel'
}).then((result) => {
if (result.value) {
return of(true) ;
}
else if (result.dismiss === Swal.DismissReason.cancel) {
this.showError("canceled" , "sth else");
return of(false) ;
}
});
//return of(false) ;
}
как я могу наблюдать значение после клика и вернуть его
я имею в виду эту часть if(result.value)