Conversation
| } else reject(this.reason) | ||
| } | ||
|
|
||
| if (this.state === 'fulfilled') { |
There was a problem hiding this comment.
С таким подходом есть проблема, что обработчик не виден в this.onRejected, а значит неверно будет обрабатываться ошибка.
Посмотри как это сделано у нас
https://github.com/V4Fire/Core/blob/master/src/core/prelude/structures/sync-promise/index.ts
| create() { | ||
| const storage = new KVStorage(new strategy()) | ||
| for (const el of this._settings) { | ||
| storage.set(...el) |
There was a problem hiding this comment.
Фомарльно ты конечно сделал все правильно, но я хотел, чтобы ты объединил разные данные и использовал set один раз, чтобы оптимизировать вставку)
| } | ||
|
|
||
|
|
||
| return !(this.event.cancelable && this.event.defaultPrevented) |
There was a problem hiding this comment.
Если уж на то пошло, то реализуй логику stopPropagation и stopImmediatePropagation
|
|
||
| function lazy(Constructor, params) { | ||
| function lazyConstructor(...args) { | ||
| if (new.target) { |
| return allKeys | ||
| } | ||
|
|
||
| const instance2 = new Constructor() |
There was a problem hiding this comment.
Ты создаешь инстанс класса в момемнт вызова функции, что противоречит "ленивой концепции".
| for (let key of allKeys) { | ||
| if (typeof instance2[key] === 'function') { | ||
| instance2[key] = function () { | ||
| queue.push(key) |
| const queue = [] | ||
|
|
||
| for (let key of allKeys) { | ||
| if (typeof instance2[key] === 'function') { |
There was a problem hiding this comment.
Записать свойсв нужно тоже сохранять, использует аксессоры
| } | ||
|
|
||
| #makeItem(el) { | ||
| return { |
No description provided.