Skip to content
This repository has been archived by the owner on Jul 8, 2018. It is now read-only.

Latest commit

 

History

History
20 lines (13 loc) · 964 Bytes

README.md

File metadata and controls

20 lines (13 loc) · 964 Bytes

Class Decor

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

function-decor support

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

Inheriting decorated methods

Decorating class methods for inheritance has some notable edge cases, see Inheriting decorated methods for further details.