zone-patch-socket-io.umd.js 1.1 KB

1234567891011121314151617181920212223242526272829
  1. 'use strict';
  2. /**
  3. * @license Angular v<unknown>
  4. * (c) 2010-2022 Google LLC. https://angular.io/
  5. * License: MIT
  6. */
  7. (function (factory) {
  8. typeof define === 'function' && define.amd ? define(factory) :
  9. factory();
  10. })((function () {
  11. 'use strict';
  12. Zone.__load_patch('socketio', function (global, Zone, api) {
  13. Zone[Zone.__symbol__('socketio')] = function patchSocketIO(io) {
  14. // patch io.Socket.prototype event listener related method
  15. api.patchEventTarget(global, api, [io.Socket.prototype], {
  16. useG: false,
  17. chkDup: false,
  18. rt: true,
  19. diff: function (task, delegate) {
  20. return task.callback === delegate;
  21. }
  22. });
  23. // also patch io.Socket.prototype.on/off/removeListener/removeAllListeners
  24. io.Socket.prototype.on = io.Socket.prototype.addEventListener;
  25. io.Socket.prototype.off = io.Socket.prototype.removeListener =
  26. io.Socket.prototype.removeAllListeners = io.Socket.prototype.removeEventListener;
  27. };
  28. });
  29. }));