Paul Woitaschek
11/02/2018, 3:56 PMpurchaseCardContents
calls purchaseCardContents
which calls toPurchaseCardContent
several times.
Now I need a class FormatSavings
in the last function toPurchaseCardContent
.
How do I get it there? When using a class for the whole logic, I just inject it through the constructor.
The issue here is that toPurchaseCardContent
doesn't know anything about purchaseCardContents
so I would need to pass-through that class and everything else it needs.
Maybe the better question is: How do I get / pass dependencies I don't want the caller to bother about in functional programming?louiscad
11/02/2018, 4:04 PMFormatParams
class if I had your use case