From ebd8c0751a11e63e877d74a68dd836cac4fcfa5c Mon Sep 17 00:00:00 2001 From: Isaiah Becker-Mayer Date: Sat, 20 Aug 2022 17:04:13 -0400 Subject: [PATCH] fixes AsyncMappedList --- src/observable/list/AsyncMappedList.ts | 24 ++++++++++++------------ src/observable/map/ApplyMap.ts | 1 - 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/observable/list/AsyncMappedList.ts b/src/observable/list/AsyncMappedList.ts index f1785c13..2c5ef63f 100644 --- a/src/observable/list/AsyncMappedList.ts +++ b/src/observable/list/AsyncMappedList.ts @@ -22,7 +22,7 @@ export class AsyncMappedList extends BaseMappedList> impleme private _eventQueue: AsyncEvent[] | null = null; private _flushing: boolean = false; - async onSubscribeFirst(): Promise { + onSubscribeFirst(): void { this._sourceUnsubscribe = this._sourceList.subscribe(this); this._eventQueue = []; this._mappedValues = []; @@ -31,7 +31,7 @@ export class AsyncMappedList extends BaseMappedList> impleme this._eventQueue.push(new AddEvent(idx, item)); idx += 1; } - await this._flush(); + void this._flush(); } async _flush(): Promise { @@ -49,38 +49,38 @@ export class AsyncMappedList extends BaseMappedList> impleme } } - async onReset(): Promise { + onReset(): void { if (this._eventQueue) { this._eventQueue.push(new ResetEvent()); - await this._flush(); + void this._flush(); } } - async onAdd(index: number, value: F): Promise { + onAdd(index: number, value: F): void { if (this._eventQueue) { this._eventQueue.push(new AddEvent(index, value)); - await this._flush(); + void this._flush(); } } - async onUpdate(index: number, value: F, params: any): Promise { + onUpdate(index: number, value: F, params: any): void { if (this._eventQueue) { this._eventQueue.push(new UpdateEvent(index, value, params)); - await this._flush(); + void this._flush(); } } - async onRemove(index: number): Promise { + onRemove(index: number): void { if (this._eventQueue) { this._eventQueue.push(new RemoveEvent(index)); - await this._flush(); + void this._flush(); } } - async onMove(fromIdx: number, toIdx: number): Promise { + onMove(fromIdx: number, toIdx: number): void { if (this._eventQueue) { this._eventQueue.push(new MoveEvent(fromIdx, toIdx)); - await this._flush(); + void this._flush(); } } diff --git a/src/observable/map/ApplyMap.ts b/src/observable/map/ApplyMap.ts index 44acd1fe..a13cf757 100644 --- a/src/observable/map/ApplyMap.ts +++ b/src/observable/map/ApplyMap.ts @@ -28,7 +28,6 @@ export class ApplyMap extends BaseObservableMap { private _subscription?: SubscriptionHandle; private _apply?: Apply; - constructor(source: BaseObservableMap, apply?: Apply) { super(); this._source = source;