Skip to content

Commit

Permalink
fix pubsub bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultJanBeyer committed Sep 25, 2023
1 parent f7e6e9f commit 152e207
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DragSelect/src/modules/PubSub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default class PubSub<E extends DSInputElement> {
) => {
for (let i = 0, il = subscribers.length; i < il; i++) {
if (this.DS.stopped) return
subscribers[i](data)
subscribers[i]?.(data)
}
}

Expand All @@ -105,7 +105,7 @@ export default class PubSub<E extends DSInputElement> {
let i = subscribers.length
while (i--) {
if (this.DS.stopped) return
subscribers[i](data)
subscribers[i]?.(data)
}
}
}

0 comments on commit 152e207

Please sign in to comment.