The class decor API allows easily and efficiently hooking into any instance method. The main use case is to customize react lifecycle methods in class components.
- onInstance - register callback to be called on instance creation
- add - add a method to a class
- defineProperties - define properties in a class's prototype
Class-decor also supports function-decor functionality over class methods:
- before - register a callback to be called before a class method is called
- after - register a callback to be called before a class method is called
- middleware - add a middleware to a method
Decorating class methods for inheritance has some notable edge cases, see Inheriting decorated methods for further details.