Organizing Pure Functions for Better Discoverability in TypeScript
How do you group your functions? My understanding is that the best thing to do is to have pure functions, which means that your pure function can exist anywhere. You don't need to have it attached to a class because it doesn't directly affect the data in that type. So you could just put all functions in files by themselves not attached to everything. Which seems more and more relevant because it makes more sense to have a function
How is the best way to solve this problem do you make a
convert(currencyIn, currencyOut) not attached to any specific currency but to work on all currencies. However that means that discoverability is not easy since the functions are not attached to everything doing Currency.fu doesn't give you function hints since convert is not attached to a typeHow is the best way to solve this problem do you make a
CurrencyOperations class to contain all your currency functions?