You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's not "unnecessary usage", your suggestion would not work the same.
The P is a populate hint, that will be inferred based on the find options, without using it, the Loaded type would not get the inferred "type value" based on the parameters, but a generic Populate<T>.
If you do em.find(Author, ['books']), the return type will be Loaded<Author, 'books'>[] - and that will allow you to access type safe getters on the populated properties (here the books collection).
For more context see the PR that introduced Loaded type hint: #691
Hi,
method signatures like this make the autocomplete suggestions in VSCode really hard to read:
I think it is even discouraged to use generic parameters in case the param type is only used once, like the
P
in your case.I suggest to change it to something this:
The less I have to skim back and forth to understand what P, T and other types are, the better!
The text was updated successfully, but these errors were encountered: