Random thoughts on TypeScript. I’ve noticed 2 things working on a larger Angular project:
- it is not common to name (aka alias) types
- type conversion either doesn’t happen, or does with not a lot of safety
Random thoughts on TypeScript. I’ve noticed 2 things working on a larger Angular project:
In the mocks vs. no mocks debate, I’ve seen a complete ignoring of nuance which I think causes confusion; it sure confuses me at least. Examples include “you don’t need mocks, only stubs” or “test behavior, not implementation”.
(more…)I’ve learned 4 things this past 6 months doing peer reviews on many teams’ code in a large Angular code base.
There are a few options, and strategies. We’ve listed from easiest to most thorough.
Record<string, any>
.IDontKnowYet
as an aliased type or interface.string | number
. If you still don’t know, use string | number | any
since we’ll know any
is the outlier.