4 ms·
totally agree. if you need a one off type for a function argument, i definitely think it's much cleaner to make it a type or interface and declare it right befo
by joshAg 5y ago
totally agree. if you need a one off type for a function argument, i definitely think it's much cleaner to make it a type or interface and declare it right before the function like you do in the final example rather than defining in-line.
- DangitBobby 5y agoThis is what I prefer as well, with the added benefit of easily being able to export the type for use somewhere else.