mini.js
Version 1.x
mini.js
is a minimal kernel of dcl
. It implements OOP facilities for single and
multiple inheritance using mixins, and super calls. Additionally it provides useful
utilities to work with objects.
There is a drop-in replacement for mini.js
(added in dcl
1.1.0), which supports
legacy browsers (tested with IE8): legacy.js. It has the same API,
and the same functionality. While it can be used instead of mini.js
on modern
browsers, it is not recommended, because legacy.js is slower than
mini.js
.
mini.js
module can be included with following commands:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Module API
The return value of this module is a function, which is called dcl()
in this documentation.
dcl() is the main “class” composition engine. While it is important by itself, it hosts a number of public properties.
Main properties:
- dcl.superCall() - super call decorator
Utilities:
- dcl.mix() - mix in one object with another
- dcl.delegate() - delegate from one object to another
Auxiliary properties:
- dcl.Super - constructor used by dcl.superCall() to create a decorator