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
wee-brown•2y 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
plain-purpleOP•2y ago
So "initialization" is when InjectQuery is called?
wee-brown•2y ago
Which exact case are you referring to?
plain-purpleOP•2y ago
For example it says that a stale query is "automatically fetched on mount"
But there were other scenarios
wee-brown•2y 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
plain-purpleOP•2y ago
What do you mean by that?
wee-brown•2y 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.plain-purpleOP•2y ago
Does that mean that the callback of
injectQuery
will not be called in injection context anymore? Please see my other question on the topicwee-brown•2y ago
Probably yes
plain-purpleOP•2y 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.