T
TanStack2y ago
other-emerald

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
foreign-sapphire
foreign-sapphire2y 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
other-emerald
other-emeraldOP2y ago
So "initialization" is when InjectQuery is called?
foreign-sapphire
foreign-sapphire2y ago
Which exact case are you referring to?
other-emerald
other-emeraldOP2y ago
For example it says that a stale query is "automatically fetched on mount" But there were other scenarios
foreign-sapphire
foreign-sapphire2y 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
other-emerald
other-emeraldOP2y ago
What do you mean by that?
foreign-sapphire
foreign-sapphire2y 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.
other-emerald
other-emeraldOP2y 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
foreign-sapphire
foreign-sapphire2y ago
Probably yes
other-emerald
other-emeraldOP2y 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?