Use finalize
this.httpClient.post('someUrl', {})
.pipe(finalize(() => window.location.replace('someOtherUrl'))
.subscribe();
or add
this.httpClient.post('someUrl', {})
.subscribe()
.add(() => window.location.replace('someOtherUrl'));
Finalize will emit for next
or error
, add
should be called on unsubscribe (HttpClient automatically completes).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…