Skip to content

Commit b6c597f

Browse files
authored
Fix unsubscribing (porsager#300)
* Fix unsubscribing Previously, unsubscribing was a no op because event listeneres were deleted from the wrong set. * fix fns when first subscribing
1 parent 3ed11e7 commit b6c597f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/subscribe.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function Subscribe(postgres, options) {
3131

3232
const fns = listeners.has(event)
3333
? listeners.get(event).add(fn)
34-
: listeners.set(event, new Set([fn]))
34+
: listeners.set(event, new Set([fn])).get(event)
3535

3636
const unsubscribe = () => {
3737
fns.delete(fn)

0 commit comments

Comments
 (0)