We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 91afde6 commit e8f5d42Copy full SHA for e8f5d42
src/index.ts
@@ -125,9 +125,10 @@ const addHandler = (
125
channels.forEach((channelId) => {
126
const existingHandlers = channelHandlersById[channelId];
127
if (existingHandlers) {
128
- existingHandlers.push(...handlers);
+ // Create a new array to avoid mutating the existing one
129
+ channelHandlersById[channelId] = [...existingHandlers, ...handlers];
130
} else {
- channelHandlersById[channelId] = handlers;
131
+ channelHandlersById[channelId] = [...handlers];
132
}
133
});
134
};
0 commit comments