DEV Community

Discussion on: Type | Treat 2021 - Day 1

Collapse
 
brunnerh profile image
brunnerh

Not fan of the suggested solution to the intermediate problem. It creates unnecessarily tight coupling between all the functions, which defeats the purpose of having them exist separately in the first place.

I would make the functions generic and only require the minimal used interface (the estimate property).

Solution

(The { estimate: number } could of course be extracted.)