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).
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.)