wrapper function

A function that calls another function, adding behaviour before or after it, such as timing, retries or logging.

In more detail

withMetrics(fn) returns a new function with the same parameters and return type as fn, which Parameters and ReturnType express. Decorators are a class-based form of the same idea.

Related terms

Taught in

References