@techstuff-dev/foundation-api-utils 1.47.0 → 1.48.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.
- package/dist/cjs/chunks/index-CfrYa4U_.js +9 -0
- package/dist/cjs/chunks/index-CfrYa4U_.js.map +1 -0
- package/dist/cjs/chunks/shared-DeNXjWb4.js +18 -0
- package/dist/cjs/chunks/shared-DeNXjWb4.js.map +1 -0
- package/dist/{index.js → cjs/chunks/slice-CAWa47E3.js} +662 -800
- package/dist/cjs/chunks/slice-CAWa47E3.js.map +1 -0
- package/dist/cjs/index.js +97 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/store/index.native.js +413 -0
- package/dist/cjs/store/index.native.js.map +1 -0
- package/dist/cjs/store/index.web.js +186 -0
- package/dist/cjs/store/index.web.js.map +1 -0
- package/dist/esm/chunks/index-KjhWa1AL.js +6 -0
- package/dist/esm/chunks/index-KjhWa1AL.js.map +1 -0
- package/dist/esm/chunks/shared-CmoKpoEq.js +15 -0
- package/dist/esm/chunks/shared-CmoKpoEq.js.map +1 -0
- package/dist/{index.esm.js → esm/chunks/slice-CRuD2Hce.js} +663 -797
- package/dist/esm/chunks/slice-CRuD2Hce.js.map +1 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/store/index.native.js +411 -0
- package/dist/esm/store/index.native.js.map +1 -0
- package/dist/esm/store/index.web.js +184 -0
- package/dist/esm/store/index.web.js.map +1 -0
- package/dist/types/index-DQ61f1lz.d.ts +1295 -0
- package/dist/{index.d.ts → types/index.d.ts} +63 -1299
- package/dist/types/store/index.d.ts +3 -0
- package/package.json +23 -9
- package/dist/index.esm.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/api/index.d.ts +0 -21
- package/dist/lib/hooks/index.d.ts +0 -4
- package/dist/lib/hooks/useAuth.d.ts +0 -1
- package/dist/lib/index.d.ts +0 -6
- package/dist/lib/services/auth/index.d.ts +0 -2027
- package/dist/lib/services/auth/slice.d.ts +0 -91
- package/dist/lib/services/cart/slice.d.ts +0 -155
- package/dist/lib/services/content/content.interfaces.d.ts +0 -801
- package/dist/lib/services/content/index.d.ts +0 -532
- package/dist/lib/services/index.d.ts +0 -7
- package/dist/lib/services/orders/index.d.ts +0 -271
- package/dist/lib/services/payment/index.d.ts +0 -1063
- package/dist/lib/store/index.d.ts +0 -2
- package/dist/lib/store/index.native.d.ts +0 -68
- package/dist/lib/store/index.web.d.ts +0 -68
- package/dist/lib/store/storage.d.ts +0 -2
- package/dist/lib/types/index.interfaces.d.ts +0 -428
- package/dist/lib/utils/dataFormat/index.d.ts +0 -86
- package/dist/lib/utils/helpers/index.d.ts +0 -14
- package/dist/node_modules/@reduxjs/toolkit/dist/uncheckedindexed.d.ts +0 -5
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { i as isAuthenticated } from './chunks/slice-CRuD2Hce.js';
|
|
2
|
+
export { O as addToCart, a as authApi, s as authSlice, J as cartSlice, c as contentApi, R as emptyCart, ag as formatAuthSession, ae as formatChallengeDays, ad as formatChallenges, aj as formatConfig, a5 as formatFaqs, ah as formatFedaratedSession, a9 as formatGuests, ap as formatLongform, aq as formatMediaItem, a6 as formatPages, a8 as formatPress, a2 as formatPromos, ac as formatSchedule, ao as formatSeasons, af as formatSecondsToISO8601Duration, al as formatSectionItems, ak as formatSectionPanels, ab as formatSections, an as formatSeries, a7 as formatSettings, a4 as formatShortform, ai as formatSocialAuthSession, am as formatTaxonomies, a1 as formatUserPayload, aa as formatVideos, a3 as formatWorkout, C as getUserSession, B as isVerifying, w as logout, o as ordersApi, p as paymentApi, Q as removeFromCart, N as removePromoCode, v as resetCreating, L as resetTaxRate, y as selectAccessToken, Y as selectCartCount, $ as selectCartItems, a0 as selectCartItemsIds, V as selectCartNetTotal, Z as selectCartStatus, X as selectCartTaxAmount, W as selectCartTaxRate, U as selectCartTotal, A as selectCurrentUser, E as selectCurrentUserRefreshToken, D as selectCurrentUserSub, T as selectMediaInCart, _ as selectPromoCode, z as selectRefreshToken, H as selectSubscription, I as selectSubscriptionPrice, G as selectUserSubscriptionStatus, F as selectUserTokens, t as setCredentials, M as setPromoCode, K as setTaxRate, S as toggleCart, P as updateCart, x as updateSubscription, k as useForgottenPasswordMutation, g as useGetUserInfoQuery, h as useLazyGetUserInfoQuery, m as useLazyVerifyUserAttributesQuery, f as useLazyVerifyUserQuery, q as useLazyVerifyUserResendQuery, d as useRegisterMutation, b as useResetPasswordAuthMutation, u as useResetPasswordMutation, j as useUpdateUserInfoMutation, r as useUpdateUserMutation, l as useVerifyUserAttributesQuery, e as useVerifyUserQuery, n as useVerifyUserResendQuery } from './chunks/slice-CRuD2Hce.js';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { useSelector } from 'react-redux';
|
|
5
|
+
import 'aws-amplify';
|
|
6
|
+
import '@reduxjs/toolkit';
|
|
7
|
+
import 'jwt-decode';
|
|
8
|
+
|
|
9
|
+
const useLoggedIn = () => {
|
|
10
|
+
const isLoggedIn = useSelector(isAuthenticated);
|
|
11
|
+
return useMemo(() => isLoggedIn, [isLoggedIn]);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { isAuthenticated, useLoggedIn };
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../lib/hooks/useAuth.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AAIO,MAAM,WAAW,GAAG,MAAK;AAC9B,IAAA,MAAM,UAAU,GAAG,WAAW,CAAC,eAAe,CAAC;IAE/C,OAAO,OAAO,CAAC,MAAM,UAAU,EAAE,CAAC,UAAU,CAAC,CAAC;AAChD;;;;"}
|
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
import { configureStore } from '@reduxjs/toolkit';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
3
|
+
import { g as getDefaultExportFromCjs, r as rootReducer } from '../chunks/shared-CmoKpoEq.js';
|
|
4
|
+
import { p as paymentApi, a as authApi, c as contentApi, o as ordersApi } from '../chunks/slice-CRuD2Hce.js';
|
|
5
|
+
import 'aws-amplify';
|
|
6
|
+
import 'react-redux';
|
|
7
|
+
import 'react';
|
|
8
|
+
import 'jwt-decode';
|
|
9
|
+
|
|
10
|
+
var isPlainObj;
|
|
11
|
+
var hasRequiredIsPlainObj;
|
|
12
|
+
|
|
13
|
+
function requireIsPlainObj () {
|
|
14
|
+
if (hasRequiredIsPlainObj) return isPlainObj;
|
|
15
|
+
hasRequiredIsPlainObj = 1;
|
|
16
|
+
|
|
17
|
+
isPlainObj = value => {
|
|
18
|
+
if (Object.prototype.toString.call(value) !== '[object Object]') {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const prototype = Object.getPrototypeOf(value);
|
|
23
|
+
return prototype === null || prototype === Object.prototype;
|
|
24
|
+
};
|
|
25
|
+
return isPlainObj;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var mergeOptions$1;
|
|
29
|
+
var hasRequiredMergeOptions;
|
|
30
|
+
|
|
31
|
+
function requireMergeOptions () {
|
|
32
|
+
if (hasRequiredMergeOptions) return mergeOptions$1;
|
|
33
|
+
hasRequiredMergeOptions = 1;
|
|
34
|
+
const isOptionObject = requireIsPlainObj();
|
|
35
|
+
|
|
36
|
+
const {hasOwnProperty} = Object.prototype;
|
|
37
|
+
const {propertyIsEnumerable} = Object;
|
|
38
|
+
const defineProperty = (object, name, value) => Object.defineProperty(object, name, {
|
|
39
|
+
value,
|
|
40
|
+
writable: true,
|
|
41
|
+
enumerable: true,
|
|
42
|
+
configurable: true
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const globalThis = mergeOptions$1;
|
|
46
|
+
const defaultMergeOptions = {
|
|
47
|
+
concatArrays: false,
|
|
48
|
+
ignoreUndefined: false
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const getEnumerableOwnPropertyKeys = value => {
|
|
52
|
+
const keys = [];
|
|
53
|
+
|
|
54
|
+
for (const key in value) {
|
|
55
|
+
if (hasOwnProperty.call(value, key)) {
|
|
56
|
+
keys.push(key);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* istanbul ignore else */
|
|
61
|
+
if (Object.getOwnPropertySymbols) {
|
|
62
|
+
const symbols = Object.getOwnPropertySymbols(value);
|
|
63
|
+
|
|
64
|
+
for (const symbol of symbols) {
|
|
65
|
+
if (propertyIsEnumerable.call(value, symbol)) {
|
|
66
|
+
keys.push(symbol);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return keys;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
function clone(value) {
|
|
75
|
+
if (Array.isArray(value)) {
|
|
76
|
+
return cloneArray(value);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (isOptionObject(value)) {
|
|
80
|
+
return cloneOptionObject(value);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return value;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function cloneArray(array) {
|
|
87
|
+
const result = array.slice(0, 0);
|
|
88
|
+
|
|
89
|
+
getEnumerableOwnPropertyKeys(array).forEach(key => {
|
|
90
|
+
defineProperty(result, key, clone(array[key]));
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
return result;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function cloneOptionObject(object) {
|
|
97
|
+
const result = Object.getPrototypeOf(object) === null ? Object.create(null) : {};
|
|
98
|
+
|
|
99
|
+
getEnumerableOwnPropertyKeys(object).forEach(key => {
|
|
100
|
+
defineProperty(result, key, clone(object[key]));
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @param {*} merged already cloned
|
|
108
|
+
* @param {*} source something to merge
|
|
109
|
+
* @param {string[]} keys keys to merge
|
|
110
|
+
* @param {Object} config Config Object
|
|
111
|
+
* @returns {*} cloned Object
|
|
112
|
+
*/
|
|
113
|
+
const mergeKeys = (merged, source, keys, config) => {
|
|
114
|
+
keys.forEach(key => {
|
|
115
|
+
if (typeof source[key] === 'undefined' && config.ignoreUndefined) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Do not recurse into prototype chain of merged
|
|
120
|
+
if (key in merged && merged[key] !== Object.getPrototypeOf(merged)) {
|
|
121
|
+
defineProperty(merged, key, merge(merged[key], source[key], config));
|
|
122
|
+
} else {
|
|
123
|
+
defineProperty(merged, key, clone(source[key]));
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
return merged;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* @param {*} merged already cloned
|
|
132
|
+
* @param {*} source something to merge
|
|
133
|
+
* @param {Object} config Config Object
|
|
134
|
+
* @returns {*} cloned Object
|
|
135
|
+
*
|
|
136
|
+
* see [Array.prototype.concat ( ...arguments )](http://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.concat)
|
|
137
|
+
*/
|
|
138
|
+
const concatArrays = (merged, source, config) => {
|
|
139
|
+
let result = merged.slice(0, 0);
|
|
140
|
+
let resultIndex = 0;
|
|
141
|
+
|
|
142
|
+
[merged, source].forEach(array => {
|
|
143
|
+
const indices = [];
|
|
144
|
+
|
|
145
|
+
// `result.concat(array)` with cloning
|
|
146
|
+
for (let k = 0; k < array.length; k++) {
|
|
147
|
+
if (!hasOwnProperty.call(array, k)) {
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
indices.push(String(k));
|
|
152
|
+
|
|
153
|
+
if (array === merged) {
|
|
154
|
+
// Already cloned
|
|
155
|
+
defineProperty(result, resultIndex++, array[k]);
|
|
156
|
+
} else {
|
|
157
|
+
defineProperty(result, resultIndex++, clone(array[k]));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// Merge non-index keys
|
|
162
|
+
result = mergeKeys(result, array, getEnumerableOwnPropertyKeys(array).filter(key => !indices.includes(key)), config);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
return result;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* @param {*} merged already cloned
|
|
170
|
+
* @param {*} source something to merge
|
|
171
|
+
* @param {Object} config Config Object
|
|
172
|
+
* @returns {*} cloned Object
|
|
173
|
+
*/
|
|
174
|
+
function merge(merged, source, config) {
|
|
175
|
+
if (config.concatArrays && Array.isArray(merged) && Array.isArray(source)) {
|
|
176
|
+
return concatArrays(merged, source, config);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (!isOptionObject(source) || !isOptionObject(merged)) {
|
|
180
|
+
return clone(source);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return mergeKeys(merged, source, getEnumerableOwnPropertyKeys(source), config);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
mergeOptions$1 = function (...options) {
|
|
187
|
+
const config = merge(clone(defaultMergeOptions), (this !== globalThis && this) || {}, defaultMergeOptions);
|
|
188
|
+
let merged = {_: {}};
|
|
189
|
+
|
|
190
|
+
for (const option of options) {
|
|
191
|
+
if (option === undefined) {
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (!isOptionObject(option)) {
|
|
196
|
+
throw new TypeError('`' + option + '` is not an Option Object');
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
merged = merge(merged, {_: option}, config);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return merged._;
|
|
203
|
+
};
|
|
204
|
+
return mergeOptions$1;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
var mergeOptionsExports = requireMergeOptions();
|
|
208
|
+
var mergeOptions = /*@__PURE__*/getDefaultExportFromCjs(mergeOptionsExports);
|
|
209
|
+
|
|
210
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
211
|
+
|
|
212
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
213
|
+
|
|
214
|
+
const merge = mergeOptions.bind({
|
|
215
|
+
concatArrays: true,
|
|
216
|
+
ignoreUndefined: true
|
|
217
|
+
});
|
|
218
|
+
function mergeLocalStorageItem(key, value) {
|
|
219
|
+
const oldValue = window.localStorage.getItem(key);
|
|
220
|
+
if (oldValue) {
|
|
221
|
+
const oldObject = JSON.parse(oldValue);
|
|
222
|
+
const newObject = JSON.parse(value);
|
|
223
|
+
const nextValue = JSON.stringify(merge(oldObject, newObject));
|
|
224
|
+
window.localStorage.setItem(key, nextValue);
|
|
225
|
+
} else {
|
|
226
|
+
window.localStorage.setItem(key, value);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
function createPromise(getValue, callback) {
|
|
230
|
+
return new Promise((resolve, reject) => {
|
|
231
|
+
try {
|
|
232
|
+
const value = getValue();
|
|
233
|
+
callback?.(null, value);
|
|
234
|
+
resolve(value);
|
|
235
|
+
} catch (err) {
|
|
236
|
+
callback?.(err);
|
|
237
|
+
reject(err);
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
function createPromiseAll(promises, callback, processResult) {
|
|
242
|
+
return Promise.all(promises).then(result => {
|
|
243
|
+
const value = processResult?.(result) ?? null;
|
|
244
|
+
callback?.(null, value);
|
|
245
|
+
return Promise.resolve(value);
|
|
246
|
+
}, errors => {
|
|
247
|
+
callback?.(errors);
|
|
248
|
+
return Promise.reject(errors);
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
const AsyncStorage = {
|
|
252
|
+
/**
|
|
253
|
+
* Fetches `key` value.
|
|
254
|
+
*/
|
|
255
|
+
getItem: (key, callback) => {
|
|
256
|
+
return createPromise(() => window.localStorage.getItem(key), callback);
|
|
257
|
+
},
|
|
258
|
+
/**
|
|
259
|
+
* Sets `value` for `key`.
|
|
260
|
+
*/
|
|
261
|
+
setItem: (key, value, callback) => {
|
|
262
|
+
return createPromise(() => window.localStorage.setItem(key, value), callback);
|
|
263
|
+
},
|
|
264
|
+
/**
|
|
265
|
+
* Removes a `key`
|
|
266
|
+
*/
|
|
267
|
+
removeItem: (key, callback) => {
|
|
268
|
+
return createPromise(() => window.localStorage.removeItem(key), callback);
|
|
269
|
+
},
|
|
270
|
+
/**
|
|
271
|
+
* Merges existing value with input value, assuming they are stringified JSON.
|
|
272
|
+
*/
|
|
273
|
+
mergeItem: (key, value, callback) => {
|
|
274
|
+
return createPromise(() => mergeLocalStorageItem(key, value), callback);
|
|
275
|
+
},
|
|
276
|
+
/**
|
|
277
|
+
* Erases *all* AsyncStorage for the domain.
|
|
278
|
+
*/
|
|
279
|
+
clear: callback => {
|
|
280
|
+
return createPromise(() => window.localStorage.clear(), callback);
|
|
281
|
+
},
|
|
282
|
+
/**
|
|
283
|
+
* Gets *all* keys known to the app, for all callers, libraries, etc.
|
|
284
|
+
*/
|
|
285
|
+
getAllKeys: callback => {
|
|
286
|
+
return createPromise(() => {
|
|
287
|
+
const numberOfKeys = window.localStorage.length;
|
|
288
|
+
const keys = [];
|
|
289
|
+
for (let i = 0; i < numberOfKeys; i += 1) {
|
|
290
|
+
const key = window.localStorage.key(i) || "";
|
|
291
|
+
keys.push(key);
|
|
292
|
+
}
|
|
293
|
+
return keys;
|
|
294
|
+
}, callback);
|
|
295
|
+
},
|
|
296
|
+
/**
|
|
297
|
+
* (stub) Flushes any pending requests using a single batch call to get the data.
|
|
298
|
+
*/
|
|
299
|
+
flushGetRequests: () => undefined,
|
|
300
|
+
/**
|
|
301
|
+
* multiGet resolves to an array of key-value pair arrays that matches the
|
|
302
|
+
* input format of multiSet.
|
|
303
|
+
*
|
|
304
|
+
* multiGet(['k1', 'k2']) -> [['k1', 'val1'], ['k2', 'val2']]
|
|
305
|
+
*/
|
|
306
|
+
multiGet: (keys, callback) => {
|
|
307
|
+
const promises = keys.map(key => AsyncStorage.getItem(key));
|
|
308
|
+
const processResult = result => result.map((value, i) => [keys[i], value]);
|
|
309
|
+
return createPromiseAll(promises, callback, processResult);
|
|
310
|
+
},
|
|
311
|
+
/**
|
|
312
|
+
* Takes an array of key-value array pairs.
|
|
313
|
+
* multiSet([['k1', 'val1'], ['k2', 'val2']])
|
|
314
|
+
*/
|
|
315
|
+
multiSet: (keyValuePairs, callback) => {
|
|
316
|
+
const promises = keyValuePairs.map(item => AsyncStorage.setItem(item[0], item[1]));
|
|
317
|
+
return createPromiseAll(promises, callback);
|
|
318
|
+
},
|
|
319
|
+
/**
|
|
320
|
+
* Delete all the keys in the `keys` array.
|
|
321
|
+
*/
|
|
322
|
+
multiRemove: (keys, callback) => {
|
|
323
|
+
const promises = keys.map(key => AsyncStorage.removeItem(key));
|
|
324
|
+
return createPromiseAll(promises, callback);
|
|
325
|
+
},
|
|
326
|
+
/**
|
|
327
|
+
* Takes an array of key-value array pairs and merges them with existing
|
|
328
|
+
* values, assuming they are stringified JSON.
|
|
329
|
+
*
|
|
330
|
+
* multiMerge([['k1', 'val1'], ['k2', 'val2']])
|
|
331
|
+
*/
|
|
332
|
+
multiMerge: (keyValuePairs, callback) => {
|
|
333
|
+
const promises = keyValuePairs.map(item => AsyncStorage.mergeItem(item[0], item[1]));
|
|
334
|
+
return createPromiseAll(promises, callback);
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
// import { createPersistStorage } from './storage';
|
|
339
|
+
// Infer the `RootState` type from the root reducer
|
|
340
|
+
// const rootReducer = combineSlices(
|
|
341
|
+
// cartSlice,
|
|
342
|
+
// authSlice,
|
|
343
|
+
// authApi,
|
|
344
|
+
// contentApi,
|
|
345
|
+
// paymentApi,
|
|
346
|
+
// ordersApi,
|
|
347
|
+
// );
|
|
348
|
+
// export type RootState = ReturnType<typeof rootReducer>;
|
|
349
|
+
// eg. ['auth', 'creating'], or an empty array if you don't want to whitelist any.
|
|
350
|
+
// const storageWhiteList: string[] = [];
|
|
351
|
+
const storageBlackList = [];
|
|
352
|
+
// `makeStore` encapsulates the store configuration to allow
|
|
353
|
+
// creating unique store instances, which is particularly important for
|
|
354
|
+
// server-side rendering (SSR) scenarios. In SSR, separate store instances
|
|
355
|
+
// are needed for each request to prevent cross-request state pollution.
|
|
356
|
+
const makeStore = () => {
|
|
357
|
+
const customEnhancers = [];
|
|
358
|
+
// const Platform: any = import('react-native').then((mod) => mod.Platform).catch(() => ({}));
|
|
359
|
+
console.log('makeNativeStore Platform', Platform);
|
|
360
|
+
let reducer;
|
|
361
|
+
let FLUSH;
|
|
362
|
+
let REHYDRATE;
|
|
363
|
+
let PAUSE;
|
|
364
|
+
let PERSIST;
|
|
365
|
+
let PURGE;
|
|
366
|
+
let REGISTER;
|
|
367
|
+
const reduxPersist = require('redux-persist');
|
|
368
|
+
const persistReducer = require('redux-persist').persistReducer;
|
|
369
|
+
FLUSH = reduxPersist.FLUSH;
|
|
370
|
+
REHYDRATE = reduxPersist.REHYDRATE;
|
|
371
|
+
PAUSE = reduxPersist.PAUSE;
|
|
372
|
+
PERSIST = reduxPersist.PERSIST;
|
|
373
|
+
PURGE = reduxPersist.PURGE;
|
|
374
|
+
REGISTER = reduxPersist.REGISTER;
|
|
375
|
+
storageBlackList.push(paymentApi.reducerPath, authApi.reducerPath, contentApi.reducerPath, ordersApi.reducerPath);
|
|
376
|
+
const persistConfig = {
|
|
377
|
+
key: 'root',
|
|
378
|
+
storage: AsyncStorage,
|
|
379
|
+
// whitelist: storageWhiteList,
|
|
380
|
+
blacklist: storageBlackList,
|
|
381
|
+
};
|
|
382
|
+
const persistedReducer = persistReducer(persistConfig, rootReducer);
|
|
383
|
+
reducer = persistedReducer;
|
|
384
|
+
const middlewares = [
|
|
385
|
+
authApi.middleware,
|
|
386
|
+
contentApi.middleware,
|
|
387
|
+
paymentApi.middleware,
|
|
388
|
+
ordersApi.middleware,
|
|
389
|
+
];
|
|
390
|
+
return configureStore({
|
|
391
|
+
reducer,
|
|
392
|
+
// Adding the api middleware enables caching, invalidation, polling,
|
|
393
|
+
// and other useful features of `rtk-query`.
|
|
394
|
+
middleware: (getDefaultMiddleware) => {
|
|
395
|
+
return getDefaultMiddleware({
|
|
396
|
+
immutableCheck: { warnAfter: 256 },
|
|
397
|
+
serializableCheck: {
|
|
398
|
+
warnAfter: 256,
|
|
399
|
+
ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER],
|
|
400
|
+
},
|
|
401
|
+
}).concat(middlewares);
|
|
402
|
+
},
|
|
403
|
+
enhancers: (getDefaultEnhancers) => {
|
|
404
|
+
return getDefaultEnhancers().concat(customEnhancers);
|
|
405
|
+
},
|
|
406
|
+
});
|
|
407
|
+
};
|
|
408
|
+
const store = makeStore();
|
|
409
|
+
|
|
410
|
+
export { store };
|
|
411
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.native.js","sources":["../../../node_modules/merge-options/node_modules/is-plain-obj/index.js","../../../node_modules/merge-options/index.js","../../../node_modules/@react-native-async-storage/async-storage/lib/module/AsyncStorage.js","../../../lib/store/index.native.ts"],"sourcesContent":["'use strict';\n\nmodule.exports = value => {\n\tif (Object.prototype.toString.call(value) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn prototype === null || prototype === Object.prototype;\n};\n","'use strict';\nconst isOptionObject = require('is-plain-obj');\n\nconst {hasOwnProperty} = Object.prototype;\nconst {propertyIsEnumerable} = Object;\nconst defineProperty = (object, name, value) => Object.defineProperty(object, name, {\n\tvalue,\n\twritable: true,\n\tenumerable: true,\n\tconfigurable: true\n});\n\nconst globalThis = this;\nconst defaultMergeOptions = {\n\tconcatArrays: false,\n\tignoreUndefined: false\n};\n\nconst getEnumerableOwnPropertyKeys = value => {\n\tconst keys = [];\n\n\tfor (const key in value) {\n\t\tif (hasOwnProperty.call(value, key)) {\n\t\t\tkeys.push(key);\n\t\t}\n\t}\n\n\t/* istanbul ignore else */\n\tif (Object.getOwnPropertySymbols) {\n\t\tconst symbols = Object.getOwnPropertySymbols(value);\n\n\t\tfor (const symbol of symbols) {\n\t\t\tif (propertyIsEnumerable.call(value, symbol)) {\n\t\t\t\tkeys.push(symbol);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn keys;\n};\n\nfunction clone(value) {\n\tif (Array.isArray(value)) {\n\t\treturn cloneArray(value);\n\t}\n\n\tif (isOptionObject(value)) {\n\t\treturn cloneOptionObject(value);\n\t}\n\n\treturn value;\n}\n\nfunction cloneArray(array) {\n\tconst result = array.slice(0, 0);\n\n\tgetEnumerableOwnPropertyKeys(array).forEach(key => {\n\t\tdefineProperty(result, key, clone(array[key]));\n\t});\n\n\treturn result;\n}\n\nfunction cloneOptionObject(object) {\n\tconst result = Object.getPrototypeOf(object) === null ? Object.create(null) : {};\n\n\tgetEnumerableOwnPropertyKeys(object).forEach(key => {\n\t\tdefineProperty(result, key, clone(object[key]));\n\t});\n\n\treturn result;\n}\n\n/**\n * @param {*} merged already cloned\n * @param {*} source something to merge\n * @param {string[]} keys keys to merge\n * @param {Object} config Config Object\n * @returns {*} cloned Object\n */\nconst mergeKeys = (merged, source, keys, config) => {\n\tkeys.forEach(key => {\n\t\tif (typeof source[key] === 'undefined' && config.ignoreUndefined) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Do not recurse into prototype chain of merged\n\t\tif (key in merged && merged[key] !== Object.getPrototypeOf(merged)) {\n\t\t\tdefineProperty(merged, key, merge(merged[key], source[key], config));\n\t\t} else {\n\t\t\tdefineProperty(merged, key, clone(source[key]));\n\t\t}\n\t});\n\n\treturn merged;\n};\n\n/**\n * @param {*} merged already cloned\n * @param {*} source something to merge\n * @param {Object} config Config Object\n * @returns {*} cloned Object\n *\n * see [Array.prototype.concat ( ...arguments )](http://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.concat)\n */\nconst concatArrays = (merged, source, config) => {\n\tlet result = merged.slice(0, 0);\n\tlet resultIndex = 0;\n\n\t[merged, source].forEach(array => {\n\t\tconst indices = [];\n\n\t\t// `result.concat(array)` with cloning\n\t\tfor (let k = 0; k < array.length; k++) {\n\t\t\tif (!hasOwnProperty.call(array, k)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tindices.push(String(k));\n\n\t\t\tif (array === merged) {\n\t\t\t\t// Already cloned\n\t\t\t\tdefineProperty(result, resultIndex++, array[k]);\n\t\t\t} else {\n\t\t\t\tdefineProperty(result, resultIndex++, clone(array[k]));\n\t\t\t}\n\t\t}\n\n\t\t// Merge non-index keys\n\t\tresult = mergeKeys(result, array, getEnumerableOwnPropertyKeys(array).filter(key => !indices.includes(key)), config);\n\t});\n\n\treturn result;\n};\n\n/**\n * @param {*} merged already cloned\n * @param {*} source something to merge\n * @param {Object} config Config Object\n * @returns {*} cloned Object\n */\nfunction merge(merged, source, config) {\n\tif (config.concatArrays && Array.isArray(merged) && Array.isArray(source)) {\n\t\treturn concatArrays(merged, source, config);\n\t}\n\n\tif (!isOptionObject(source) || !isOptionObject(merged)) {\n\t\treturn clone(source);\n\t}\n\n\treturn mergeKeys(merged, source, getEnumerableOwnPropertyKeys(source), config);\n}\n\nmodule.exports = function (...options) {\n\tconst config = merge(clone(defaultMergeOptions), (this !== globalThis && this) || {}, defaultMergeOptions);\n\tlet merged = {_: {}};\n\n\tfor (const option of options) {\n\t\tif (option === undefined) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!isOptionObject(option)) {\n\t\t\tthrow new TypeError('`' + option + '` is not an Option Object');\n\t\t}\n\n\t\tmerged = merge(merged, {_: option}, config);\n\t}\n\n\treturn merged._;\n};\n","\"use strict\";\n\n/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport mergeOptions from \"merge-options\";\n\n// eslint-disable-next-line @typescript-eslint/ban-types\n\n// eslint-disable-next-line @typescript-eslint/ban-types\n\nconst merge = mergeOptions.bind({\n concatArrays: true,\n ignoreUndefined: true\n});\nfunction mergeLocalStorageItem(key, value) {\n const oldValue = window.localStorage.getItem(key);\n if (oldValue) {\n const oldObject = JSON.parse(oldValue);\n const newObject = JSON.parse(value);\n const nextValue = JSON.stringify(merge(oldObject, newObject));\n window.localStorage.setItem(key, nextValue);\n } else {\n window.localStorage.setItem(key, value);\n }\n}\nfunction createPromise(getValue, callback) {\n return new Promise((resolve, reject) => {\n try {\n const value = getValue();\n callback?.(null, value);\n resolve(value);\n } catch (err) {\n callback?.(err);\n reject(err);\n }\n });\n}\nfunction createPromiseAll(promises, callback, processResult) {\n return Promise.all(promises).then(result => {\n const value = processResult?.(result) ?? null;\n callback?.(null, value);\n return Promise.resolve(value);\n }, errors => {\n callback?.(errors);\n return Promise.reject(errors);\n });\n}\nconst AsyncStorage = {\n /**\n * Fetches `key` value.\n */\n getItem: (key, callback) => {\n return createPromise(() => window.localStorage.getItem(key), callback);\n },\n /**\n * Sets `value` for `key`.\n */\n setItem: (key, value, callback) => {\n return createPromise(() => window.localStorage.setItem(key, value), callback);\n },\n /**\n * Removes a `key`\n */\n removeItem: (key, callback) => {\n return createPromise(() => window.localStorage.removeItem(key), callback);\n },\n /**\n * Merges existing value with input value, assuming they are stringified JSON.\n */\n mergeItem: (key, value, callback) => {\n return createPromise(() => mergeLocalStorageItem(key, value), callback);\n },\n /**\n * Erases *all* AsyncStorage for the domain.\n */\n clear: callback => {\n return createPromise(() => window.localStorage.clear(), callback);\n },\n /**\n * Gets *all* keys known to the app, for all callers, libraries, etc.\n */\n getAllKeys: callback => {\n return createPromise(() => {\n const numberOfKeys = window.localStorage.length;\n const keys = [];\n for (let i = 0; i < numberOfKeys; i += 1) {\n const key = window.localStorage.key(i) || \"\";\n keys.push(key);\n }\n return keys;\n }, callback);\n },\n /**\n * (stub) Flushes any pending requests using a single batch call to get the data.\n */\n flushGetRequests: () => undefined,\n /**\n * multiGet resolves to an array of key-value pair arrays that matches the\n * input format of multiSet.\n *\n * multiGet(['k1', 'k2']) -> [['k1', 'val1'], ['k2', 'val2']]\n */\n multiGet: (keys, callback) => {\n const promises = keys.map(key => AsyncStorage.getItem(key));\n const processResult = result => result.map((value, i) => [keys[i], value]);\n return createPromiseAll(promises, callback, processResult);\n },\n /**\n * Takes an array of key-value array pairs.\n * multiSet([['k1', 'val1'], ['k2', 'val2']])\n */\n multiSet: (keyValuePairs, callback) => {\n const promises = keyValuePairs.map(item => AsyncStorage.setItem(item[0], item[1]));\n return createPromiseAll(promises, callback);\n },\n /**\n * Delete all the keys in the `keys` array.\n */\n multiRemove: (keys, callback) => {\n const promises = keys.map(key => AsyncStorage.removeItem(key));\n return createPromiseAll(promises, callback);\n },\n /**\n * Takes an array of key-value array pairs and merges them with existing\n * values, assuming they are stringified JSON.\n *\n * multiMerge([['k1', 'val1'], ['k2', 'val2']])\n */\n multiMerge: (keyValuePairs, callback) => {\n const promises = keyValuePairs.map(item => AsyncStorage.mergeItem(item[0], item[1]));\n return createPromiseAll(promises, callback);\n }\n};\nexport default AsyncStorage;\n//# sourceMappingURL=AsyncStorage.js.map",null],"names":["require$$0","this","mergeOptions","storage"],"mappings":";;;;;;;;;;;;;;;;AAEA,CAAA,UAAc,GAAG,KAAK,IAAI;AAC1B,EAAC,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,iBAAiB,EAAE;AAClE,GAAE,OAAO,KAAK;AACd,EAAA;;EAEC,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC;EAC9C,OAAO,SAAS,KAAK,IAAI,IAAI,SAAS,KAAK,MAAM,CAAC,SAAS;CAC5D,CAAC;;;;;;;;;;CCRD,MAAM,cAAc,GAAGA,iBAAA,EAAuB;;AAE9C,CAAA,MAAM,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC,SAAS;AACzC,CAAA,MAAM,CAAC,oBAAoB,C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,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC;AACpE,iBAAA;AACF,aAAA,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC;QACxB,CAAC;AACD,QAAA,SAAS,EAAE,CAAC,mBAAmB,KAAI;AACjC,YAAA,OAAO,mBAAmB,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;QACtD,CAAC;AACF,KAAA,CAAC;AACJ,CAAC;AAEM,MAAM,KAAK,GAAG,SAAS;;;;","x_google_ignoreList":[0,1,2]}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { configureStore } from '@reduxjs/toolkit';
|
|
2
|
+
import { p as paymentApi, a as authApi, c as contentApi, o as ordersApi } from '../chunks/slice-CRuD2Hce.js';
|
|
3
|
+
import { g as getDefaultExportFromCjs, r as rootReducer } from '../chunks/shared-CmoKpoEq.js';
|
|
4
|
+
import 'aws-amplify';
|
|
5
|
+
import 'react-redux';
|
|
6
|
+
import 'react';
|
|
7
|
+
import 'jwt-decode';
|
|
8
|
+
|
|
9
|
+
var createWebStorage$1 = {};
|
|
10
|
+
|
|
11
|
+
var getStorage = {};
|
|
12
|
+
|
|
13
|
+
var hasRequiredGetStorage;
|
|
14
|
+
|
|
15
|
+
function requireGetStorage () {
|
|
16
|
+
if (hasRequiredGetStorage) return getStorage;
|
|
17
|
+
hasRequiredGetStorage = 1;
|
|
18
|
+
|
|
19
|
+
getStorage.__esModule = true;
|
|
20
|
+
getStorage.default = getStorage$1;
|
|
21
|
+
|
|
22
|
+
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
23
|
+
|
|
24
|
+
function noop() {}
|
|
25
|
+
|
|
26
|
+
var noopStorage = {
|
|
27
|
+
getItem: noop,
|
|
28
|
+
setItem: noop,
|
|
29
|
+
removeItem: noop
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
function hasStorage(storageType) {
|
|
33
|
+
if ((typeof self === "undefined" ? "undefined" : _typeof(self)) !== 'object' || !(storageType in self)) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
try {
|
|
38
|
+
var storage = self[storageType];
|
|
39
|
+
var testKey = "redux-persist ".concat(storageType, " test");
|
|
40
|
+
storage.setItem(testKey, 'test');
|
|
41
|
+
storage.getItem(testKey);
|
|
42
|
+
storage.removeItem(testKey);
|
|
43
|
+
} catch (e) {
|
|
44
|
+
if (process.env.NODE_ENV !== 'production') console.warn("redux-persist ".concat(storageType, " test failed, persistence will be disabled."));
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function getStorage$1(type) {
|
|
52
|
+
var storageType = "".concat(type, "Storage");
|
|
53
|
+
if (hasStorage(storageType)) return self[storageType];else {
|
|
54
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
55
|
+
console.error("redux-persist failed to create sync storage. falling back to noop storage.");
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return noopStorage;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return getStorage;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
var hasRequiredCreateWebStorage;
|
|
65
|
+
|
|
66
|
+
function requireCreateWebStorage () {
|
|
67
|
+
if (hasRequiredCreateWebStorage) return createWebStorage$1;
|
|
68
|
+
hasRequiredCreateWebStorage = 1;
|
|
69
|
+
|
|
70
|
+
createWebStorage$1.__esModule = true;
|
|
71
|
+
createWebStorage$1.default = createWebStorage;
|
|
72
|
+
|
|
73
|
+
var _getStorage = _interopRequireDefault(requireGetStorage());
|
|
74
|
+
|
|
75
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
76
|
+
|
|
77
|
+
function createWebStorage(type) {
|
|
78
|
+
var storage = (0, _getStorage.default)(type);
|
|
79
|
+
return {
|
|
80
|
+
getItem: function getItem(key) {
|
|
81
|
+
return new Promise(function (resolve, reject) {
|
|
82
|
+
resolve(storage.getItem(key));
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
setItem: function setItem(key, item) {
|
|
86
|
+
return new Promise(function (resolve, reject) {
|
|
87
|
+
resolve(storage.setItem(key, item));
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
removeItem: function removeItem(key) {
|
|
91
|
+
return new Promise(function (resolve, reject) {
|
|
92
|
+
resolve(storage.removeItem(key));
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
return createWebStorage$1;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
var createWebStorageExports = requireCreateWebStorage();
|
|
101
|
+
var createWebStorage = /*@__PURE__*/getDefaultExportFromCjs(createWebStorageExports);
|
|
102
|
+
|
|
103
|
+
// @ts-expect-error - required for module alias
|
|
104
|
+
function createPersistStorage() {
|
|
105
|
+
const isServer = typeof window === 'undefined';
|
|
106
|
+
// Returns noop (dummy) storage.
|
|
107
|
+
if (isServer) {
|
|
108
|
+
return {
|
|
109
|
+
getItem() {
|
|
110
|
+
return Promise.resolve(null);
|
|
111
|
+
},
|
|
112
|
+
setItem() {
|
|
113
|
+
return Promise.resolve();
|
|
114
|
+
},
|
|
115
|
+
removeItem() {
|
|
116
|
+
return Promise.resolve();
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
return createWebStorage('local');
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Infer the `RootState` type from the root reducer
|
|
124
|
+
// const rootReducer = combineSlices(
|
|
125
|
+
// cartSlice,
|
|
126
|
+
// authSlice,
|
|
127
|
+
// authApi,
|
|
128
|
+
// contentApi,
|
|
129
|
+
// paymentApi,
|
|
130
|
+
// ordersApi,
|
|
131
|
+
// );
|
|
132
|
+
// export type RootState = ReturnType<typeof rootReducer>;
|
|
133
|
+
// eg. ['auth', 'creating'], or an empty array if you don't want to whitelist any.
|
|
134
|
+
// const storageWhiteList: string[] = [];
|
|
135
|
+
const storageBlackList = [];
|
|
136
|
+
const makeStore = () => {
|
|
137
|
+
const reduxPersist = require('redux-persist');
|
|
138
|
+
const persistReducer = require('redux-persist').persistReducer;
|
|
139
|
+
const FLUSH = reduxPersist.FLUSH;
|
|
140
|
+
const REHYDRATE = reduxPersist.REHYDRATE;
|
|
141
|
+
const PAUSE = reduxPersist.PAUSE;
|
|
142
|
+
const PERSIST = reduxPersist.PERSIST;
|
|
143
|
+
const PURGE = reduxPersist.PURGE;
|
|
144
|
+
const REGISTER = reduxPersist.REGISTER;
|
|
145
|
+
const storage = createPersistStorage();
|
|
146
|
+
storageBlackList.push(paymentApi.reducerPath, authApi.reducerPath, contentApi.reducerPath, ordersApi.reducerPath);
|
|
147
|
+
const persistConfig = {
|
|
148
|
+
key: 'root',
|
|
149
|
+
storage: storage,
|
|
150
|
+
// whitelist: storageWhiteList,
|
|
151
|
+
blacklist: storageBlackList,
|
|
152
|
+
};
|
|
153
|
+
const middlewares = [
|
|
154
|
+
authApi.middleware,
|
|
155
|
+
contentApi.middleware,
|
|
156
|
+
paymentApi.middleware,
|
|
157
|
+
ordersApi.middleware,
|
|
158
|
+
];
|
|
159
|
+
// `combineSlices` automatically combines the reducers using
|
|
160
|
+
// their `reducerPath`s, therefore we no longer need to call `combineReducers`.
|
|
161
|
+
const persistedReducer = persistReducer(persistConfig, rootReducer);
|
|
162
|
+
const customEnhancers = [];
|
|
163
|
+
return configureStore({
|
|
164
|
+
reducer: persistedReducer,
|
|
165
|
+
// Adding the api middleware enables caching, invalidation, polling,
|
|
166
|
+
// and other useful features of `rtk-query`.
|
|
167
|
+
middleware: (getDefaultMiddleware) => {
|
|
168
|
+
return getDefaultMiddleware({
|
|
169
|
+
immutableCheck: { warnAfter: 256 },
|
|
170
|
+
serializableCheck: {
|
|
171
|
+
warnAfter: 256,
|
|
172
|
+
ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER],
|
|
173
|
+
},
|
|
174
|
+
}).concat(middlewares);
|
|
175
|
+
},
|
|
176
|
+
enhancers: (getDefaultEnhancers) => {
|
|
177
|
+
return getDefaultEnhancers().concat(customEnhancers);
|
|
178
|
+
},
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
const store = makeStore();
|
|
182
|
+
|
|
183
|
+
export { store };
|
|
184
|
+
//# sourceMappingURL=index.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.web.js","sources":["../../../node_modules/redux-persist/lib/storage/getStorage.js","../../../node_modules/redux-persist/lib/storage/createWebStorage.js","../../../lib/store/storage.ts","../../../lib/store/index.web.ts"],"sourcesContent":["\"use strict\";\n\nexports.__esModule = true;\nexports.default = getStorage;\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction noop() {}\n\nvar noopStorage = {\n getItem: noop,\n setItem: noop,\n removeItem: noop\n};\n\nfunction hasStorage(storageType) {\n if ((typeof self === \"undefined\" ? \"undefined\" : _typeof(self)) !== 'object' || !(storageType in self)) {\n return false;\n }\n\n try {\n var storage = self[storageType];\n var testKey = \"redux-persist \".concat(storageType, \" test\");\n storage.setItem(testKey, 'test');\n storage.getItem(testKey);\n storage.removeItem(testKey);\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') console.warn(\"redux-persist \".concat(storageType, \" test failed, persistence will be disabled.\"));\n return false;\n }\n\n return true;\n}\n\nfunction getStorage(type) {\n var storageType = \"\".concat(type, \"Storage\");\n if (hasStorage(storageType)) return self[storageType];else {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\"redux-persist failed to create sync storage. falling back to noop storage.\");\n }\n\n return noopStorage;\n }\n}","\"use strict\";\n\nexports.__esModule = true;\nexports.default = createWebStorage;\n\nvar _getStorage = _interopRequireDefault(require(\"./getStorage\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction createWebStorage(type) {\n var storage = (0, _getStorage.default)(type);\n return {\n getItem: function getItem(key) {\n return new Promise(function (resolve, reject) {\n resolve(storage.getItem(key));\n });\n },\n setItem: function setItem(key, item) {\n return new Promise(function (resolve, reject) {\n resolve(storage.setItem(key, item));\n });\n },\n removeItem: function removeItem(key) {\n return new Promise(function (resolve, reject) {\n resolve(storage.removeItem(key));\n });\n }\n };\n}",null,null],"names":["getStorage_1","getStorage","createWebStorage_1","require$$0"],"mappings":";;;;;;;;;;;;;;;;;;AAEA,CAAAA,UAAO,cAAc,IAAI;AACzB,CAAAA,UAAA,CAAA,OAAe,GAAGC,YAAU;;AAE5B,CAAA,SAAS,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,OAAO,MAAM,KAAK,UAAU,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ,EAAE,EAAE,OAAO,GAAG,SAAS,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,OAAO,GAAG,CAAC,CAAA,CAAE,CAAC,EAAE,MAAM,EAAE,OAAO,GAAG,SAAS,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,GAAG,IAAI,OAAO,MAAM,KAAK,UAAU,IAAI,GAAG,CAAC,WAAW,KAAK,MAAM,IAAI,GAAG,KAAK,MAAM,CAAC,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,CAAC,CAAA,CAAE,CAAC,EAAE,CAAC,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;;AAE7V,CAAA,SAAS,IAAI,GAAG,CAAA;;AAEhB,CAAA,IAAI,WAAW,GAAG;GAChB,OAAO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