Every hook has its own type (e.g TTest) but in the implementation every function uses their own local type, this causes a possible misalignment inside the code, it's error prone and does not give any advantage
Quick example (code is random, this applies to each and every hook)
The hook has its own type:
type TUseMyHook {
someFunction: (someValue: ValueType ) => TSomeType
}
but inside the hook every function is declared like this
Every hook has its own type (e.g
TTest
) but in the implementation every function uses their own local type, this causes a possible misalignment inside the code, it's error prone and does not give any advantageQuick example (code is random, this applies to each and every hook)
The hook has its own type:
but inside the hook every function is declared like this
so if I change for example
ValueType
toValueType | AnotherType
the change is not applied to theTUseMyHook
type!We could solve it easily by removing local types in the implementations, and using something like