@commercetools-frontend/sdk 21.14.3 → 21.16.0

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.
@@ -335,7 +335,7 @@ var index = /*#__PURE__*/Object.freeze({
335
335
  });
336
336
 
337
337
  // NOTE: This string will be replaced on build time with the package version.
338
- var version = "21.14.3";
338
+ var version = "21.16.0";
339
339
 
340
340
  /* eslint-disable no-console */
341
341
  var isLoggerEnabled = function isLoggerEnabled() {
@@ -685,13 +685,11 @@ function createSdkMiddleware(_ref) {
685
685
  return middleware;
686
686
  }
687
687
 
688
+ // Wraps `dispatch` and cast the return type to a Promise, as the middleware
688
689
  // returns a Promise.
689
-
690
690
  function useAsyncDispatch() {
691
691
  var dispatch = reactRedux.useDispatch();
692
- return function (action) {
693
- return dispatch(action);
694
- };
692
+ return dispatch;
695
693
  }
696
694
 
697
695
  var Sdk = {
@@ -326,7 +326,7 @@ var index = /*#__PURE__*/Object.freeze({
326
326
  });
327
327
 
328
328
  // NOTE: This string will be replaced on build time with the package version.
329
- var version = "21.14.3";
329
+ var version = "21.16.0";
330
330
 
331
331
  var mcHostnameRegex = /^mc(-(\d){4,})?\.(.*)$/;
332
332
  var mcPreviewHostnameRegex = /^.*\.mc-preview\.(.*)$/;
@@ -577,13 +577,11 @@ function createSdkMiddleware(_ref) {
577
577
  return middleware;
578
578
  }
579
579
 
580
+ // Wraps `dispatch` and cast the return type to a Promise, as the middleware
580
581
  // returns a Promise.
581
-
582
582
  function useAsyncDispatch() {
583
583
  var dispatch = reactRedux.useDispatch();
584
- return function (action) {
585
- return dispatch(action);
586
- };
584
+ return dispatch;
587
585
  }
588
586
 
589
587
  var Sdk = {
@@ -311,7 +311,7 @@ var index = /*#__PURE__*/Object.freeze({
311
311
  });
312
312
 
313
313
  // NOTE: This string will be replaced on build time with the package version.
314
- var version = "21.14.3";
314
+ var version = "21.16.0";
315
315
 
316
316
  /* eslint-disable no-console */
317
317
  var isLoggerEnabled = function isLoggerEnabled() {
@@ -661,13 +661,11 @@ function createSdkMiddleware(_ref) {
661
661
  return middleware;
662
662
  }
663
663
 
664
+ // Wraps `dispatch` and cast the return type to a Promise, as the middleware
664
665
  // returns a Promise.
665
-
666
666
  function useAsyncDispatch() {
667
667
  var dispatch = useDispatch();
668
- return function (action) {
669
- return dispatch(action);
670
- };
668
+ return dispatch;
671
669
  }
672
670
 
673
671
  var Sdk = {
@@ -1,3 +1,4 @@
1
1
  import type { TSdkAction } from '../types';
2
- declare function useAsyncDispatch<Action extends TSdkAction, Data>(): (action: Action) => Promise<Data>;
2
+ declare type TAsyncDispatch<Action extends TSdkAction, Data> = (action: Action) => Promise<Data>;
3
+ declare function useAsyncDispatch<Action extends TSdkAction, Data>(): TAsyncDispatch<Action, Data>;
3
4
  export default useAsyncDispatch;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-frontend/sdk",
3
- "version": "21.14.3",
3
+ "version": "21.16.0",
4
4
  "description": "Tools for declarative fetching",
5
5
  "bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
6
6
  "repository": {
@@ -23,12 +23,12 @@
23
23
  "dependencies": {
24
24
  "@babel/runtime": "^7.19.0",
25
25
  "@babel/runtime-corejs3": "^7.19.0",
26
- "@commercetools-frontend/constants": "21.14.3",
26
+ "@commercetools-frontend/constants": "21.16.0",
27
27
  "@commercetools/api-request-builder": "6.0.0",
28
28
  "@commercetools/http-user-agent": "3.0.0",
29
29
  "@commercetools/sdk-client": "3.0.0",
30
30
  "@commercetools/sdk-middleware-correlation-id": "3.0.0",
31
- "@commercetools/sdk-middleware-http": "7.0.0",
31
+ "@commercetools/sdk-middleware-http": "7.0.1",
32
32
  "@types/node-fetch": "2.6.2",
33
33
  "@types/prop-types": "^15.7.5",
34
34
  "@types/react": "^17.0.49",
@@ -45,7 +45,7 @@
45
45
  "@testing-library/react": "12.1.5",
46
46
  "@types/uuid": "8.3.4",
47
47
  "react": "17.0.2",
48
- "react-redux": "7.2.8",
48
+ "react-redux": "7.2.9",
49
49
  "redux": "4.2.0",
50
50
  "redux-thunk": "2.4.1"
51
51
  },