dcl.js
Version 1.x
dcl.js
is a standard kernel of dcl
. It augments mini.js. While mini.js implements OOP facilities,
and supercalls, dcl.js
adds AOP, chaining, and more utilities.
It can be included with following commands:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
Module API
The return value of this module is a function, which is called dcl()
in this documentation.
dcl() is the same function returned by mini.js, but augmented with new functionality and new public properties.
Main properties:
- dcl.advise() - AOP advise decorator, used to weave methods
- dcl.chainBefore() - function to declare chaining “before” for a method
- dcl.chainAfter() - function to declare chaining “after” for a method
Helpers:
- dcl.before() - shortcut for a “before” advice
- dcl.around() - shortcut for an “around” advice
- dcl.after() - shortcut for an “after” advice
Utilities:
- dcl.isInstanceOf() - checks if an object is an instance of a constructor
Auxiliary properties:
- dcl.Advice - constructor used by dcl.advise() to create a decorator