@pooflabs/core 0.0.36 → 0.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -4355,7 +4355,10 @@ function handleServerMessage(connection, message) {
4355
4355
  }
4356
4356
  function notifyCallbacks(subscription, data) {
4357
4357
  var _a;
4358
- for (const callback of subscription.callbacks) {
4358
+ // Snapshot the callbacks array so that unsubscriptions during
4359
+ // notification don't cause callbacks to be skipped.
4360
+ const callbacks = subscription.callbacks.slice();
4361
+ for (const callback of callbacks) {
4359
4362
  try {
4360
4363
  (_a = callback.onData) === null || _a === void 0 ? void 0 : _a.call(callback, data);
4361
4364
  }