Skip to content

Commit 33e3891

Browse files
committed
Add tasks
1 parent 1843a3b commit 33e3891

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

+25
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,28 @@ Tasks:
44
- see examples
55
- implement `extend(obj, ...objects)` so keys from objects will be mixed into obj only if it doesn't contain those keys
66
- 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+
```

0 commit comments

Comments
 (0)