@apollo/client 3.8.3 → 3.8.5

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.
Files changed (97) hide show
  1. package/README.md +8 -6
  2. package/apollo-client.cjs +57 -73
  3. package/apollo-client.cjs.map +1 -1
  4. package/apollo-client.min.cjs +1 -1
  5. package/config/jest/setup.js +10 -0
  6. package/config/jest/setup.js.map +1 -1
  7. package/core/ObservableQuery.d.ts.map +1 -1
  8. package/core/ObservableQuery.js +5 -6
  9. package/core/ObservableQuery.js.map +1 -1
  10. package/core/QueryInfo.d.ts +0 -2
  11. package/core/QueryInfo.d.ts.map +1 -1
  12. package/core/QueryInfo.js +0 -2
  13. package/core/QueryInfo.js.map +1 -1
  14. package/core/QueryManager.d.ts +1 -1
  15. package/core/QueryManager.d.ts.map +1 -1
  16. package/core/QueryManager.js +2 -2
  17. package/core/QueryManager.js.map +1 -1
  18. package/core/core.cjs +8 -11
  19. package/core/core.cjs.map +1 -1
  20. package/core/core.cjs.native.js +8 -11
  21. package/dev/dev.cjs +30 -16
  22. package/dev/dev.cjs.map +1 -1
  23. package/dev/dev.cjs.native.js +30 -16
  24. package/dev/loadErrorMessageHandler.js +1 -1
  25. package/dev/loadErrorMessageHandler.js.map +1 -1
  26. package/package.json +30 -23
  27. package/react/cache/index.d.ts +0 -4
  28. package/react/cache/index.d.ts.map +1 -1
  29. package/react/cache/index.js +0 -14
  30. package/react/cache/index.js.map +1 -1
  31. package/react/index.d.ts +0 -1
  32. package/react/index.d.ts.map +1 -1
  33. package/react/index.js +0 -1
  34. package/react/index.js.map +1 -1
  35. package/react/react.cjs +1 -218
  36. package/react/react.cjs.map +1 -1
  37. package/react/react.cjs.native.js +1 -218
  38. package/react/types/types.d.ts +0 -3
  39. package/react/types/types.d.ts.map +1 -1
  40. package/react/types/types.js.map +1 -1
  41. package/testing/core/withConsoleSpy.d.ts.map +1 -1
  42. package/testing/core/withConsoleSpy.js.map +1 -1
  43. package/testing/internal/ObservableStream.d.ts +26 -0
  44. package/testing/internal/ObservableStream.d.ts.map +1 -0
  45. package/testing/internal/ObservableStream.js +101 -0
  46. package/testing/internal/ObservableStream.js.map +1 -0
  47. package/testing/internal/disposables/index.d.ts +3 -0
  48. package/testing/internal/disposables/index.d.ts.map +1 -0
  49. package/testing/internal/disposables/index.js +3 -0
  50. package/testing/internal/disposables/index.js.map +1 -0
  51. package/testing/internal/disposables/spyOnConsole.d.ts +10 -0
  52. package/testing/internal/disposables/spyOnConsole.d.ts.map +1 -0
  53. package/testing/internal/disposables/spyOnConsole.js +33 -0
  54. package/testing/internal/disposables/spyOnConsole.js.map +1 -0
  55. package/testing/internal/disposables/withCleanup.d.ts +3 -0
  56. package/testing/internal/disposables/withCleanup.d.ts.map +1 -0
  57. package/testing/internal/disposables/withCleanup.js +11 -0
  58. package/testing/internal/disposables/withCleanup.js.map +1 -0
  59. package/testing/internal/index.d.ts +4 -0
  60. package/testing/internal/index.d.ts.map +1 -0
  61. package/testing/internal/index.js +4 -0
  62. package/testing/internal/index.js.map +1 -0
  63. package/testing/internal/profile/Render.d.ts +140 -0
  64. package/testing/internal/profile/Render.d.ts.map +1 -0
  65. package/testing/internal/profile/Render.js +132 -0
  66. package/testing/internal/profile/Render.js.map +1 -0
  67. package/testing/internal/profile/index.d.ts +4 -0
  68. package/testing/internal/profile/index.d.ts.map +1 -0
  69. package/testing/internal/profile/index.js +2 -0
  70. package/testing/internal/profile/index.js.map +1 -0
  71. package/testing/internal/profile/profile.d.ts +55 -0
  72. package/testing/internal/profile/profile.d.ts.map +1 -0
  73. package/testing/internal/profile/profile.js +222 -0
  74. package/testing/internal/profile/profile.js.map +1 -0
  75. package/testing/internal/profile/traces.d.ts +3 -0
  76. package/testing/internal/profile/traces.d.ts.map +1 -0
  77. package/testing/internal/profile/traces.js +26 -0
  78. package/testing/internal/profile/traces.js.map +1 -0
  79. package/testing/matchers/ProfiledComponent.d.ts +8 -0
  80. package/testing/matchers/ProfiledComponent.d.ts.map +1 -0
  81. package/testing/matchers/ProfiledComponent.js +107 -0
  82. package/testing/matchers/ProfiledComponent.js.map +1 -0
  83. package/testing/matchers/index.js +3 -0
  84. package/testing/matchers/index.js.map +1 -1
  85. package/utilities/globals/globals.cjs +31 -16
  86. package/utilities/globals/globals.cjs.map +1 -1
  87. package/utilities/globals/globals.cjs.native.js +31 -16
  88. package/utilities/globals/invariantWrappers.d.ts.map +1 -1
  89. package/utilities/globals/invariantWrappers.js +30 -15
  90. package/utilities/globals/invariantWrappers.js.map +1 -1
  91. package/utilities/observables/asyncMap.d.ts.map +1 -1
  92. package/utilities/observables/asyncMap.js +17 -34
  93. package/utilities/observables/asyncMap.js.map +1 -1
  94. package/utilities/utilities.cjs +17 -34
  95. package/utilities/utilities.cjs.map +1 -1
  96. package/utilities/utilities.cjs.native.js +17 -34
  97. package/version.js +1 -1
@@ -1249,48 +1249,31 @@ function iterateObserversSafely(observers, method, argument) {
1249
1249
 
1250
1250
  function asyncMap(observable, mapFn, catchFn) {
1251
1251
  return new zenObservableTs.Observable(function (observer) {
1252
- var next = observer.next, error = observer.error, complete = observer.complete;
1253
- var activeCallbackCount = 0;
1254
- var completed = false;
1255
1252
  var promiseQueue = {
1256
1253
  then: function (callback) {
1257
1254
  return new Promise(function (resolve) { return resolve(callback()); });
1258
1255
  },
1259
1256
  };
1260
- function makeCallback(examiner, delegate) {
1261
- if (examiner) {
1262
- return function (arg) {
1263
- ++activeCallbackCount;
1264
- var both = function () { return examiner(arg); };
1265
- promiseQueue = promiseQueue
1266
- .then(both, both)
1267
- .then(function (result) {
1268
- --activeCallbackCount;
1269
- next && next.call(observer, result);
1270
- if (completed) {
1271
- handler.complete();
1272
- }
1273
- }, function (error) {
1274
- --activeCallbackCount;
1275
- throw error;
1276
- })
1277
- .catch(function (caught) {
1278
- error && error.call(observer, caught);
1279
- });
1280
- };
1281
- }
1282
- else {
1283
- return function (arg) { return delegate && delegate.call(observer, arg); };
1284
- }
1257
+ function makeCallback(examiner, key) {
1258
+ return function (arg) {
1259
+ if (examiner) {
1260
+ var both = function () {
1261
+ return observer.closed
1262
+ ? 0
1263
+ : examiner(arg);
1264
+ };
1265
+ promiseQueue = promiseQueue.then(both, both).then(function (result) { return observer.next(result); }, function (error) { return observer.error(error); });
1266
+ }
1267
+ else {
1268
+ observer[key](arg);
1269
+ }
1270
+ };
1285
1271
  }
1286
1272
  var handler = {
1287
- next: makeCallback(mapFn, next),
1288
- error: makeCallback(catchFn, error),
1273
+ next: makeCallback(mapFn, "next"),
1274
+ error: makeCallback(catchFn, "error"),
1289
1275
  complete: function () {
1290
- completed = true;
1291
- if (!activeCallbackCount) {
1292
- complete && complete.call(observer);
1293
- }
1276
+ promiseQueue.then(function () { return observer.complete(); });
1294
1277
  },
1295
1278
  };
1296
1279
  var sub = observable.subscribe(handler);
package/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export var version = "3.8.3";
1
+ export var version = "3.8.5";
2
2
  //# sourceMappingURL=version.js.map