RXJS 5.5以上finally()转变为finalize()
作者:互联网
RXJS 5.5以下判断方法执行完毕的回调写法:
1 this.saving = true; 2 this.service.createData(this.data) 3 .finally(() => { 4 this.saving = false; 5 }) 6 .subscribe((data) => { 7 this.notify.success(this.l('保存成功'), ''); 8 });
RXJS 5.5以上判断方法执行完毕的回调写法:
1 this.isLoading=true; 2 this.service.createData(this.data) 3 .pipe(finalize(()=>{this.isLoading=false;})) 4 .subscribe(data => { 5 this.notify.success(this.l('保存成功'), ''); 6 })
标签:saving,5.5,finalize,true,subscribe,finally,RXJS,data 来源: https://www.cnblogs.com/sugarwxx/p/16416743.html