Skip to content

Commit

Permalink
fix: remove empty sequence map entry
Browse files Browse the repository at this point in the history
  • Loading branch information
roennibus authored Jun 7, 2022
1 parent c1902e6 commit e66063e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion projects/ngneat/hotkeys/src/lib/hotkeys.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export class HotkeysService {
this.hotkeys.delete(hotkey);
this.dispose.next(hotkey);

this.sequenceMaps.forEach(v => {
this.sequenceMaps.forEach((v, k) => {
const summary = v.hotkeyMap.get(hotkey);
if (summary) {
summary.subject.observers
Expand All @@ -209,6 +209,7 @@ export class HotkeysService {
}
if (v.hotkeyMap.size === 0) {
v.subscription.unsubscribe();
this.sequenceMaps.delete(k);
}
});
});
Expand Down

0 comments on commit e66063e

Please sign in to comment.