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
As you can clearly see, I have to repeat declarations twice: once, in $ngRedux.connect() and second, in the controller to be type-safe. If, for some reason, I start refactoring this code, by changing names of properties in connect() or changing the action creators' names imported in ./actions, this code will not throw any compilation error.
Question: is there a way to improve type-safety with $ngRedux.connect()? Maybe connect() should limit properties/actions in map***ToTarget to only those that are declared in the controller?
The text was updated successfully, but these errors were encountered:
arutkowski00
changed the title
[TS} Type safety is not good enough with connect()
[TS] Type safety is not good enough when using $ngRedux.connect()
Aug 29, 2018
Hello,
let me present you some code to start with:
As you can clearly see, I have to repeat declarations twice: once, in
$ngRedux.connect()
and second, in the controller to be type-safe. If, for some reason, I start refactoring this code, by changing names of properties inconnect()
or changing the action creators' names imported in./actions
, this code will not throw any compilation error.Question: is there a way to improve type-safety with
$ngRedux.connect()
? Maybeconnect()
should limit properties/actions inmap***ToTarget
to only those that are declared in the controller?The text was updated successfully, but these errors were encountered: