如何解决参数类型 (key:string) => Observable | 的问题 有效载荷类型 | 不能分配给“(值:字符串,索引:数字)=> ObersvableInput”类型的参数
return action$.pipe(
filter(a => a.type === 'ACTION'),
mergeMap(action => {
hideLoadingMask();
return askForMessageDialog({
title: 'test',
type: 'question',
text: getLocalized('test'),
buttons: [
{ key: 'cancel', caption: 'cancel'},
{ key: 'notSave', caption: 'notSave' },
{ key: 'save', caption: 'save' }],
primaryButtonKey: cancel
}).pipe(
mergeMap((key) => {
switch (key) {
case notSave: {
return refresh();
}
case save: {
return saveChanges();
}
default:
return empty();
}
})
);
})
);