Skip to content

Commit d81a7de

Browse files
committed
Handle multiple instances for connecting via API
1 parent 51b3220 commit d81a7de

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/app/api/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ export function connect(config = {}) {
9393
listeners[id].push(listener);
9494

9595
return function unsubscribe() {
96-
const index = listeners.indexOf(listener);
96+
const index = listeners[id].indexOf(listener);
9797
listeners[id].splice(index, 1);
9898
};
9999
};
100100

101-
const unsubscribe = (instanceId) => {
102-
delete listeners[instanceId];
101+
const unsubscribe = () => {
102+
delete listeners[id];
103103
};
104104

105105
const send = (action, state) => {

0 commit comments

Comments
 (0)