File tree 1 file changed +25
-0
lines changed
1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 4
4
- see examples
5
5
- implement ` extend(obj, ...objects) ` so keys from objects will be mixed into obj only if it doesn't contain those keys
6
6
- implement ` wrap(obj, ...funcs) ` so if obj contains func.name it should be wrapped
7
+ - implement mixin ` logable() `
8
+ - implement universal ` equilateral ` mixin for for N sides (see ` 6-class.js ` )
9
+ - implement ` emitable ` with ` Object.defineProperty ` (see ` 6-evants.js ` )
10
+ - implement mixin for prototypes (not instances)
11
+ - implement ` extend ` for mixins with additional ` override:Boolean ` flag
12
+ ``` js
13
+ const mix2 = [
14
+ {
15
+ override: true ,
16
+ toString () {
17
+ return ` ${ this .name } - ${ this .city } - ${ this .born } ` ;
18
+ }
19
+ },
20
+ {
21
+ override: false ,
22
+ age () {
23
+ const year = new Date ().getFullYear ();
24
+ const born = new Date (this .born ).getFullYear ();
25
+ return year - born;
26
+ }
27
+ }
28
+ ];
29
+
30
+ extend (obj1, mix1, mix2);
31
+ ```
You can’t perform that action at this time.
0 commit comments