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
Typescript 3.4 added a language feature to turn array literals into narrowly typed readonly tuples using the as const type assertion. It would improve the experience of typed-inject if we could use this syntax instead of having to import and use the tokens() helper function to specify dependencies. Right now it does not work because readonly arrays cannot be assigned to mutable arrays (which inject is assumed to be), so we get a type error in the provideXX() or injectXX() call.
As mentioned by @nicojs this would be a possible feature for a new (major) release.
The text was updated successfully, but these errors were encountered:
Typescript 3.4 added a language feature to turn array literals into narrowly typed readonly tuples using the
as const
type assertion. It would improve the experience of typed-inject if we could use this syntax instead of having to import and use thetokens()
helper function to specify dependencies. Right now it does not work because readonly arrays cannot be assigned to mutable arrays (whichinject
is assumed to be), so we get a type error in theprovideXX()
orinjectXX()
call.As mentioned by @nicojs this would be a possible feature for a new (major) release.
The text was updated successfully, but these errors were encountered: