addInitializer

A method on a decorator's context that registers a function to run when each instance, or the class itself, is set up.

In more detail

It is used for work such as binding a method to its instance or registering the class somewhere, without editing the constructor. Initializers added from a method decorator run while each new instance is being constructed.

Related terms

Taught in

References