T
TanStack17mo ago
extended-salmon

What does "query mount" means on Angular?

I know what "mount" means in react, but I'm not sure what does that term mean in Angular. It's mentioned a couple of times in the docs.
10 Replies
quickest-silver
quickest-silver17mo ago
Initialization is the term I usually replace mount with for Angular. I'll go through the docs again to check for leftover "mount" mentions PR welcome too of course
extended-salmon
extended-salmonOP17mo ago
So "initialization" is when InjectQuery is called?
quickest-silver
quickest-silver17mo ago
Which exact case are you referring to?
extended-salmon
extended-salmonOP17mo ago
For example it says that a stale query is "automatically fetched on mount" But there were other scenarios
quickest-silver
quickest-silver17mo ago
Yes when it's initialized or maybe injected is a more correct term Although it's now done lazily either when a signal is read or on next tick to support required signals
extended-salmon
extended-salmonOP17mo ago
What do you mean by that?
quickest-silver
quickest-silver17mo ago
To support input.required for example. If that signal would be read too early an exception would be thrown. injectQuery should "just work" without having to be bothered by component lifecycle. To make that possible I made the query initialization lazy, either on signal read or on next tick.
extended-salmon
extended-salmonOP17mo ago
Does that mean that the callback of injectQuery will not be called in injection context anymore? Please see my other question on the topic
quickest-silver
quickest-silver17mo ago
Probably yes
extended-salmon
extended-salmonOP17mo ago
That's a big problem, because it will make it very hard to share query options with dependencies We shoul probably set it up so injection will "just work" in every function.

Did you find this page helpful?