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
When watching multiple sources you don't have to do explicit const assertion on the input array.
What does the proposed API look like?
Since TypeScript 4.0 and the ability to use generics in the tupel spread syntax, the sources parameter in watch can always be made a tupel type. Basically change the type of sources from T to readonly [...T]:
Yes, this would not work in a version smaller 4.0. In previous versions, there is nothing similar that I know of at least. However, there are discussions like this one that make me believe, that there is not really a straightforward solution. I guess this can be kept in mind for the future.
What problem does this feature solve?
When watching multiple sources you don't have to do explicit const assertion on the input array.
What does the proposed API look like?
Since TypeScript 4.0 and the ability to use generics in the tupel spread syntax, the
sources
parameter inwatch
can always be made a tupel type. Basically change the type ofsources
fromT
toreadonly [...T]
:The text was updated successfully, but these errors were encountered: