Hi, Is there the simplest(better) way to create a ...
# announcements
m
Hi, Is there the simplest(better) way to create a decorator to some function
Copy code
fun <T> newDecoratedFunction(actual: T, expected: T, functionInitial: (paramA: T, paramB: T) -> Unit) {
        functionInitial(paramA, paramB)
        additionalCode(paramA,paramB)
}
As a result, the usage is the following:
Copy code
newDecoratedFunction(passedParameterA, passedParameterB) {
paramA: SomeType1, paramB: SomeType2 -> functionInitial(paramA, paramB)
}