問題タブ [request-cancelling]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
rxjs - angular5のHttpインターセプターでリクエストをキャンセルするには?
私の角度アプリには「listdata.component.ts」というコンポーネントがあります。このコンポーネントの ngOnInit() では、2 つの API 呼び出しが発生します。しかし、2 つの要求に対して 401 応答が得られると、ログアウト API 呼び出しが 2 回行われます。私のインターセプターコード
1 つの 401 応答の後、すべての 401 要求をキャンセルし、ログアウトを 1 回だけ呼び出したいと思います。