ngx-file-drop
ngx-file-drop copied to clipboard
dropEventTimerSubscription: late unsubscription
Related to https://github.com/georgipeltekov/ngx-file-drop/issues/224
The dropEventTimerSubscription is not unsubscribed after dropped finished. It is still there and fires until the next drop event or the component is destroyed. This has the side effect that the angular change detection also runs every 200ms.
Maybe with a code like the following insteded of just using numOfActiveReadEntries--, the dropEventTimer in https://github.com/georgipeltekov/ngx-file-drop/blob/b63662c3b233376d929c1c073a820f0b045bfc4b/src/ngx-file-drop/ngx-file-drop.component.ts#L225 is not necessary anymore:
decrementNumOfActiveReadEntries () {
this.numOfActiveReadEntries --;
if (this.numOfActiveReadEntries == 0) {
this.zone.run(() =>
const files = this.files;
this.files = [];
this.onFileDrop.emit(files);
}
}