Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Angular: injectMutation skips pending state when triggered in constructor or ngOnInit

オープン
#9,020 コメント 1 件 リアクション 0 件 担当者 2 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@benjavicente がすでに取り組んでいます。

2026年10月2日 から。

  • #9098 @ThiloAschebrock による — マージされずにクローズ

評価

この issue はまだ評価されていません。

説明

Describe the bug

useMutation does indicate a pending state and remains idle until the mutation concludes if triggered in a Component constructor or ngOnInit lifecycle method, whereas triggering the mutation from ngAfterContentInit works as expected.

Your minimal, reproducible example

https://stackblitz.com/edit/angular-query-aqv6yuzm?file=src%2Fmain.ts

Steps to reproduce
  1. Refresh the page.
  2. Observe the state changes for the three mutations triggered in an Angular constructor, ngOnInit, or ngAfterContentInit.
  3. Notice that the two mutations triggered in the constructor and ngOnInit remain idle and do not indicate the pending state while the mutations are running.
Expected behavior

As a user, I expect the mutation to always indicate the correct idle and pending state, i.e., switch from idle to pending when a mutation has been triggered.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform
  • OS: Windows, maxOS,
  • Browser: Chrome, Edge
Tanstack Query adapter

angular-query

TanStack Query version

v5.74.3

TypeScript version

v5.6.3

Additional context

No response

主要言語
TypeScript
スター
50.4k
フォーク
4.2k
平均マージ
11時間 33分
マージ済み PR(30日)
421

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TanStack/query のほかの issue

TanStack/query の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。