https://kotlinlang.org logo
#http4k
Title
d

David Hamilton

11/25/2018, 11:52 AM
Another question: we have a number of microservices using a helper object that does the standard filter setup for adding metrics, logging and error-handling filters. However we're reaching the point where the various apps need to pass some additional filters of their own. So far we've added individual optional filters parameters like
optionalFilter: Filter = Filter.NoOp
We'd now rather refactor the growing number of parameters into
additionalFilters: List<Filter>
However my functional skills are not up to wiring a variable number of filters into the chain (I can do it procedurally, obviously, but I'm assuming there's a better pattern). What's the best way to do this?