@open-tender/cloud 0.0.23 → 0.0.25

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.
@@ -24,4 +24,5 @@ export declare const selectCustomerLoyaltyProgram: (state: AppState) => {
24
24
  };
25
25
  export declare const selectCustomerPointsProgram: (orderType: OrderType) => (state: AppState) => import("@open-tender/types").CustomerLoyalty | null;
26
26
  export declare const selectCustomerPoints: (orderType: OrderType) => (state: AppState) => import("@open-tender/types").LoyaltyPoints | null;
27
+ export declare const selectPointsProgram: (state: AppState) => import("@open-tender/types").CustomerLoyalty | null;
27
28
  export declare const customerLoyaltyReducer: import("redux").Reducer<CustomerLoyaltyState, import("redux").AnyAction>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.customerLoyaltyReducer = exports.selectCustomerPoints = exports.selectCustomerPointsProgram = exports.selectCustomerLoyaltyProgram = exports.selectCustomerLoyalty = exports.setCustomerLoyalty = exports.resetCustomerLoyaltyError = exports.resetCustomerLoyalty = exports.fetchCustomerLoyalty = exports.CustomerLoyaltyActionType = void 0;
4
+ exports.customerLoyaltyReducer = exports.selectPointsProgram = exports.selectCustomerPoints = exports.selectCustomerPointsProgram = exports.selectCustomerLoyaltyProgram = exports.selectCustomerLoyalty = exports.setCustomerLoyalty = exports.resetCustomerLoyaltyError = exports.resetCustomerLoyalty = exports.fetchCustomerLoyalty = exports.CustomerLoyaltyActionType = void 0;
5
5
  const tslib_1 = require("tslib");
6
6
  const toolkit_1 = require("@reduxjs/toolkit");
7
7
  const types_1 = require("../types");
@@ -84,4 +84,9 @@ const selectCustomerPoints = (orderType) => (state) => {
84
84
  return program ? program.points : null;
85
85
  };
86
86
  exports.selectCustomerPoints = selectCustomerPoints;
87
+ const selectPointsProgram = (state) => {
88
+ const { orderType } = state.order;
89
+ return orderType ? (0, exports.selectCustomerPointsProgram)(orderType)(state) : null;
90
+ };
91
+ exports.selectPointsProgram = selectPointsProgram;
87
92
  exports.customerLoyaltyReducer = customerLoyaltySlice.reducer;
@@ -24,4 +24,5 @@ export declare const selectCustomerLoyaltyProgram: (state: AppState) => {
24
24
  };
25
25
  export declare const selectCustomerPointsProgram: (orderType: OrderType) => (state: AppState) => import("@open-tender/types").CustomerLoyalty | null;
26
26
  export declare const selectCustomerPoints: (orderType: OrderType) => (state: AppState) => import("@open-tender/types").LoyaltyPoints | null;
27
+ export declare const selectPointsProgram: (state: AppState) => import("@open-tender/types").CustomerLoyalty | null;
27
28
  export declare const customerLoyaltyReducer: import("redux").Reducer<CustomerLoyaltyState, import("redux").AnyAction>;
@@ -76,4 +76,8 @@ export const selectCustomerPoints = (orderType) => (state) => {
76
76
  const program = selectCustomerPointsProgram(orderType)(state);
77
77
  return program ? program.points : null;
78
78
  };
79
+ export const selectPointsProgram = (state) => {
80
+ const { orderType } = state.order;
81
+ return orderType ? selectCustomerPointsProgram(orderType)(state) : null;
82
+ };
79
83
  export const customerLoyaltyReducer = customerLoyaltySlice.reducer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/cloud",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our cloud-based Order API.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -55,7 +55,7 @@
55
55
  "react": "^18.2.0"
56
56
  },
57
57
  "dependencies": {
58
- "@open-tender/types": "^0.0.60",
59
- "@open-tender/utils": "^0.0.9"
58
+ "@open-tender/types": "^0.0.63",
59
+ "@open-tender/utils": "^0.0.12"
60
60
  }
61
61
  }