redux-astroglide 0.1.21 → 0.1.24

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/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react-redux')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'react-redux'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["redux-astroglide"] = {}, global.reactRedux));
5
- })(this, (function (exports, reactRedux) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["redux-astroglide"] = {}));
5
+ })(this, (function (exports) { 'use strict';
6
6
 
7
7
  function _arrayLikeToArray(r, a) {
8
8
  (null == a || a > r.length) && (a = r.length);
@@ -5625,23 +5625,6 @@
5625
5625
  var upperFirst = createCaseFirst('toUpperCase');
5626
5626
  var upperFirst_1 = upperFirst;
5627
5627
 
5628
- const callbackObj = {
5629
- onAddMiddleware: () => {
5630
- throw Error("You can't inject middleware until after the store has been initialized.");
5631
- }
5632
- };
5633
- const injectMiddleware = middleware => {
5634
- callbackObj.onAddMiddleware(middleware);
5635
- };
5636
- const injectableMiddleware = store => _next => {
5637
- let next = _next;
5638
- callbackObj.onAddMiddleware = middleware => {
5639
- const currentNextFn = next;
5640
- next = compose(middleware(store))(currentNextFn); // wrap the previous `next` function with this new one, a la redux
5641
- };
5642
- return action => next(action);
5643
- };
5644
-
5645
5628
  var react = {exports: {}};
5646
5629
 
5647
5630
  var react_production_min = {};
@@ -8417,11 +8400,378 @@
8417
8400
  }
8418
8401
  })(react);
8419
8402
 
8403
+ var withSelector = {exports: {}};
8404
+
8405
+ var useSyncExternalStoreWithSelector_production = {};
8406
+
8407
+ /**
8408
+ * @license React
8409
+ * use-sync-external-store-with-selector.production.js
8410
+ *
8411
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
8412
+ *
8413
+ * This source code is licensed under the MIT license found in the
8414
+ * LICENSE file in the root directory of this source tree.
8415
+ */
8416
+ var hasRequiredUseSyncExternalStoreWithSelector_production;
8417
+ function requireUseSyncExternalStoreWithSelector_production() {
8418
+ if (hasRequiredUseSyncExternalStoreWithSelector_production) return useSyncExternalStoreWithSelector_production;
8419
+ hasRequiredUseSyncExternalStoreWithSelector_production = 1;
8420
+ var React = react.exports;
8421
+ function is(x, y) {
8422
+ return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
8423
+ }
8424
+ var objectIs = "function" === typeof Object.is ? Object.is : is,
8425
+ useSyncExternalStore = React.useSyncExternalStore,
8426
+ useRef = React.useRef,
8427
+ useEffect = React.useEffect,
8428
+ useMemo = React.useMemo,
8429
+ useDebugValue = React.useDebugValue;
8430
+ useSyncExternalStoreWithSelector_production.useSyncExternalStoreWithSelector = function (subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
8431
+ var instRef = useRef(null);
8432
+ if (null === instRef.current) {
8433
+ var inst = {
8434
+ hasValue: !1,
8435
+ value: null
8436
+ };
8437
+ instRef.current = inst;
8438
+ } else inst = instRef.current;
8439
+ instRef = useMemo(function () {
8440
+ function memoizedSelector(nextSnapshot) {
8441
+ if (!hasMemo) {
8442
+ hasMemo = !0;
8443
+ memoizedSnapshot = nextSnapshot;
8444
+ nextSnapshot = selector(nextSnapshot);
8445
+ if (void 0 !== isEqual && inst.hasValue) {
8446
+ var currentSelection = inst.value;
8447
+ if (isEqual(currentSelection, nextSnapshot)) return memoizedSelection = currentSelection;
8448
+ }
8449
+ return memoizedSelection = nextSnapshot;
8450
+ }
8451
+ currentSelection = memoizedSelection;
8452
+ if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;
8453
+ var nextSelection = selector(nextSnapshot);
8454
+ if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) return memoizedSnapshot = nextSnapshot, currentSelection;
8455
+ memoizedSnapshot = nextSnapshot;
8456
+ return memoizedSelection = nextSelection;
8457
+ }
8458
+ var hasMemo = !1,
8459
+ memoizedSnapshot,
8460
+ memoizedSelection,
8461
+ maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
8462
+ return [function () {
8463
+ return memoizedSelector(getSnapshot());
8464
+ }, null === maybeGetServerSnapshot ? void 0 : function () {
8465
+ return memoizedSelector(maybeGetServerSnapshot());
8466
+ }];
8467
+ }, [getSnapshot, getServerSnapshot, selector, isEqual]);
8468
+ var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
8469
+ useEffect(function () {
8470
+ inst.hasValue = !0;
8471
+ inst.value = value;
8472
+ }, [value]);
8473
+ useDebugValue(value);
8474
+ return value;
8475
+ };
8476
+ return useSyncExternalStoreWithSelector_production;
8477
+ }
8478
+
8479
+ var useSyncExternalStoreWithSelector_development = {};
8480
+
8481
+ /**
8482
+ * @license React
8483
+ * use-sync-external-store-with-selector.development.js
8484
+ *
8485
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
8486
+ *
8487
+ * This source code is licensed under the MIT license found in the
8488
+ * LICENSE file in the root directory of this source tree.
8489
+ */
8490
+ var hasRequiredUseSyncExternalStoreWithSelector_development;
8491
+ function requireUseSyncExternalStoreWithSelector_development() {
8492
+ if (hasRequiredUseSyncExternalStoreWithSelector_development) return useSyncExternalStoreWithSelector_development;
8493
+ hasRequiredUseSyncExternalStoreWithSelector_development = 1;
8494
+ "production" !== process.env.NODE_ENV && function () {
8495
+ function is(x, y) {
8496
+ return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
8497
+ }
8498
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
8499
+ var React = react.exports,
8500
+ objectIs = "function" === typeof Object.is ? Object.is : is,
8501
+ useSyncExternalStore = React.useSyncExternalStore,
8502
+ useRef = React.useRef,
8503
+ useEffect = React.useEffect,
8504
+ useMemo = React.useMemo,
8505
+ useDebugValue = React.useDebugValue;
8506
+ useSyncExternalStoreWithSelector_development.useSyncExternalStoreWithSelector = function (subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
8507
+ var instRef = useRef(null);
8508
+ if (null === instRef.current) {
8509
+ var inst = {
8510
+ hasValue: !1,
8511
+ value: null
8512
+ };
8513
+ instRef.current = inst;
8514
+ } else inst = instRef.current;
8515
+ instRef = useMemo(function () {
8516
+ function memoizedSelector(nextSnapshot) {
8517
+ if (!hasMemo) {
8518
+ hasMemo = !0;
8519
+ memoizedSnapshot = nextSnapshot;
8520
+ nextSnapshot = selector(nextSnapshot);
8521
+ if (void 0 !== isEqual && inst.hasValue) {
8522
+ var currentSelection = inst.value;
8523
+ if (isEqual(currentSelection, nextSnapshot)) return memoizedSelection = currentSelection;
8524
+ }
8525
+ return memoizedSelection = nextSnapshot;
8526
+ }
8527
+ currentSelection = memoizedSelection;
8528
+ if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;
8529
+ var nextSelection = selector(nextSnapshot);
8530
+ if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) return memoizedSnapshot = nextSnapshot, currentSelection;
8531
+ memoizedSnapshot = nextSnapshot;
8532
+ return memoizedSelection = nextSelection;
8533
+ }
8534
+ var hasMemo = !1,
8535
+ memoizedSnapshot,
8536
+ memoizedSelection,
8537
+ maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
8538
+ return [function () {
8539
+ return memoizedSelector(getSnapshot());
8540
+ }, null === maybeGetServerSnapshot ? void 0 : function () {
8541
+ return memoizedSelector(maybeGetServerSnapshot());
8542
+ }];
8543
+ }, [getSnapshot, getServerSnapshot, selector, isEqual]);
8544
+ var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
8545
+ useEffect(function () {
8546
+ inst.hasValue = !0;
8547
+ inst.value = value;
8548
+ }, [value]);
8549
+ useDebugValue(value);
8550
+ return value;
8551
+ };
8552
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
8553
+ }();
8554
+ return useSyncExternalStoreWithSelector_development;
8555
+ }
8556
+
8557
+ (function (module) {
8558
+
8559
+ if (process.env.NODE_ENV === 'production') {
8560
+ module.exports = requireUseSyncExternalStoreWithSelector_production();
8561
+ } else {
8562
+ module.exports = requireUseSyncExternalStoreWithSelector_development();
8563
+ }
8564
+ })(withSelector);
8565
+
8566
+ // src/utils/react.ts
8567
+
8568
+ // src/utils/shallowEqual.ts
8569
+ function is(x, y) {
8570
+ if (x === y) {
8571
+ return x !== 0 || y !== 0 || 1 / x === 1 / y;
8572
+ } else {
8573
+ return x !== x && y !== y;
8574
+ }
8575
+ }
8576
+ function shallowEqual(objA, objB) {
8577
+ if (is(objA, objB)) return true;
8578
+ if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
8579
+ return false;
8580
+ }
8581
+ const keysA = Object.keys(objA);
8582
+ const keysB = Object.keys(objB);
8583
+ if (keysA.length !== keysB.length) return false;
8584
+ for (let i = 0; i < keysA.length; i++) {
8585
+ if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
8586
+ return false;
8587
+ }
8588
+ }
8589
+ return true;
8590
+ }
8591
+
8592
+ // src/components/Context.ts
8593
+ var ContextKey = /* @__PURE__ */ Symbol.for(`react-redux-context`);
8594
+ var gT = typeof globalThis !== "undefined" ? globalThis : (
8595
+ /* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */
8596
+ {}
8597
+ );
8598
+ function getContext() {
8599
+ if (!react.exports.createContext) return {};
8600
+ const contextMap = gT[ContextKey] ??= /* @__PURE__ */ new Map();
8601
+ let realContext = contextMap.get(react.exports.createContext);
8602
+ if (!realContext) {
8603
+ realContext = react.exports.createContext(
8604
+ null
8605
+ );
8606
+ if (process.env.NODE_ENV !== "production") {
8607
+ realContext.displayName = "ReactRedux";
8608
+ }
8609
+ contextMap.set(react.exports.createContext, realContext);
8610
+ }
8611
+ return realContext;
8612
+ }
8613
+ var ReactReduxContext = /* @__PURE__ */ getContext();
8614
+
8615
+ // src/hooks/useReduxContext.ts
8616
+ function createReduxContextHook(context = ReactReduxContext) {
8617
+ return function useReduxContext2() {
8618
+ const contextValue = react.exports.useContext(context);
8619
+ if (process.env.NODE_ENV !== "production" && !contextValue) {
8620
+ throw new Error(
8621
+ "could not find react-redux context value; please ensure the component is wrapped in a <Provider>"
8622
+ );
8623
+ }
8624
+ return contextValue;
8625
+ };
8626
+ }
8627
+ var useReduxContext = /* @__PURE__ */ createReduxContextHook();
8628
+
8629
+ // src/hooks/useStore.ts
8630
+ function createStoreHook(context = ReactReduxContext) {
8631
+ const useReduxContext2 = context === ReactReduxContext ? useReduxContext : (
8632
+ // @ts-ignore
8633
+ createReduxContextHook(context)
8634
+ );
8635
+ const useStore2 = () => {
8636
+ const { store } = useReduxContext2();
8637
+ return store;
8638
+ };
8639
+ Object.assign(useStore2, {
8640
+ withTypes: () => useStore2
8641
+ });
8642
+ return useStore2;
8643
+ }
8644
+ var useStore = /* @__PURE__ */ createStoreHook();
8645
+
8646
+ // src/hooks/useDispatch.ts
8647
+ function createDispatchHook(context = ReactReduxContext) {
8648
+ const useStore2 = context === ReactReduxContext ? useStore : createStoreHook(context);
8649
+ const useDispatch2 = () => {
8650
+ const store = useStore2();
8651
+ return store.dispatch;
8652
+ };
8653
+ Object.assign(useDispatch2, {
8654
+ withTypes: () => useDispatch2
8655
+ });
8656
+ return useDispatch2;
8657
+ }
8658
+ var useDispatch = /* @__PURE__ */ createDispatchHook();
8659
+ var refEquality = (a, b) => a === b;
8660
+ function createSelectorHook$1(context = ReactReduxContext) {
8661
+ const useReduxContext2 = context === ReactReduxContext ? useReduxContext : createReduxContextHook(context);
8662
+ const useSelector2 = (selector, equalityFnOrOptions = {}) => {
8663
+ const { equalityFn = refEquality } = typeof equalityFnOrOptions === "function" ? { equalityFn: equalityFnOrOptions } : equalityFnOrOptions;
8664
+ if (process.env.NODE_ENV !== "production") {
8665
+ if (!selector) {
8666
+ throw new Error(`You must pass a selector to useSelector`);
8667
+ }
8668
+ if (typeof selector !== "function") {
8669
+ throw new Error(`You must pass a function as a selector to useSelector`);
8670
+ }
8671
+ if (typeof equalityFn !== "function") {
8672
+ throw new Error(
8673
+ `You must pass a function as an equality function to useSelector`
8674
+ );
8675
+ }
8676
+ }
8677
+ const reduxContext = useReduxContext2();
8678
+ const { store, subscription, getServerState } = reduxContext;
8679
+ const firstRun = react.exports.useRef(true);
8680
+ const wrappedSelector = react.exports.useCallback(
8681
+ {
8682
+ [selector.name](state) {
8683
+ const selected = selector(state);
8684
+ if (process.env.NODE_ENV !== "production") {
8685
+ const { devModeChecks = {} } = typeof equalityFnOrOptions === "function" ? {} : equalityFnOrOptions;
8686
+ const { identityFunctionCheck, stabilityCheck } = reduxContext;
8687
+ const {
8688
+ identityFunctionCheck: finalIdentityFunctionCheck,
8689
+ stabilityCheck: finalStabilityCheck
8690
+ } = {
8691
+ stabilityCheck,
8692
+ identityFunctionCheck,
8693
+ ...devModeChecks
8694
+ };
8695
+ if (finalStabilityCheck === "always" || finalStabilityCheck === "once" && firstRun.current) {
8696
+ const toCompare = selector(state);
8697
+ if (!equalityFn(selected, toCompare)) {
8698
+ let stack = void 0;
8699
+ try {
8700
+ throw new Error();
8701
+ } catch (e) {
8702
+ ({ stack } = e);
8703
+ }
8704
+ console.warn(
8705
+ "Selector " + (selector.name || "unknown") + " returned a different result when called with the same parameters. This can lead to unnecessary rerenders.\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization",
8706
+ {
8707
+ state,
8708
+ selected,
8709
+ selected2: toCompare,
8710
+ stack
8711
+ }
8712
+ );
8713
+ }
8714
+ }
8715
+ if (finalIdentityFunctionCheck === "always" || finalIdentityFunctionCheck === "once" && firstRun.current) {
8716
+ if (selected === state) {
8717
+ let stack = void 0;
8718
+ try {
8719
+ throw new Error();
8720
+ } catch (e) {
8721
+ ({ stack } = e);
8722
+ }
8723
+ console.warn(
8724
+ "Selector " + (selector.name || "unknown") + " returned the root state when called. This can lead to unnecessary rerenders.\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.",
8725
+ { stack }
8726
+ );
8727
+ }
8728
+ }
8729
+ if (firstRun.current) firstRun.current = false;
8730
+ }
8731
+ return selected;
8732
+ }
8733
+ }[selector.name],
8734
+ [selector]
8735
+ );
8736
+ const selectedState = withSelector.exports.useSyncExternalStoreWithSelector(
8737
+ subscription.addNestedSub,
8738
+ store.getState,
8739
+ getServerState || store.getState,
8740
+ wrappedSelector,
8741
+ equalityFn
8742
+ );
8743
+ react.exports.useDebugValue(selectedState);
8744
+ return selectedState;
8745
+ };
8746
+ Object.assign(useSelector2, {
8747
+ withTypes: () => useSelector2
8748
+ });
8749
+ return useSelector2;
8750
+ }
8751
+ var useSelector = /* @__PURE__ */ createSelectorHook$1();
8752
+
8753
+ const callbackObj = {
8754
+ onAddMiddleware: () => {
8755
+ throw Error("You can't inject middleware until after the store has been initialized.");
8756
+ }
8757
+ };
8758
+ const injectMiddleware = middleware => {
8759
+ callbackObj.onAddMiddleware(middleware);
8760
+ };
8761
+ const injectableMiddleware = store => _next => {
8762
+ let next = _next;
8763
+ callbackObj.onAddMiddleware = middleware => {
8764
+ const currentNextFn = next;
8765
+ next = compose(middleware(store))(currentNextFn); // wrap the previous `next` function with this new one, a la redux
8766
+ };
8767
+ return action => next(action);
8768
+ };
8769
+
8420
8770
  var useAction = function useAction(action, deps) {
8421
8771
  return useActions([action], deps)[0];
8422
8772
  };
8423
8773
  var useActions = function useActions(actions, deps) {
8424
- var dispatch = reactRedux.useDispatch();
8774
+ var dispatch = useDispatch();
8425
8775
  return react.exports.useMemo(function () {
8426
8776
  if (Array.isArray(actions)) {
8427
8777
  return actions.map(function (a) {
@@ -8553,12 +8903,12 @@
8553
8903
 
8554
8904
  var makeSelectorHook = function makeSelectorHook(selector) {
8555
8905
  return function () {
8556
- return reactRedux.useSelector(selector, reactRedux.shallowEqual);
8906
+ return useSelector(selector, shallowEqual);
8557
8907
  };
8558
8908
  };
8559
8909
  var createSelectorUpdateHook = function createSelectorUpdateHook(selector, action) {
8560
8910
  return function () {
8561
- return [reactRedux.useSelector(selector), useAction(action, undefined)];
8911
+ return [useSelector(selector), useAction(action, undefined)];
8562
8912
  };
8563
8913
  };
8564
8914
  var createSelectorHook = function createSelectorHook() {
@@ -8626,7 +8976,7 @@
8626
8976
  var setterCb = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (value) {
8627
8977
  return value;
8628
8978
  };
8629
- return [reactRedux.useSelector(selector), useAction(function (value) {
8979
+ return [useSelector(selector), useAction(function (value) {
8630
8980
  return updateAction(setterCb(value));
8631
8981
  }, undefined)];
8632
8982
  };
@@ -8658,15 +9008,86 @@
8658
9008
 
8659
9009
  var _excluded = ["middleware", "devTools", "preloadedState", "enhancers"],
8660
9010
  _excluded2 = ["selectDomain"];
8661
- var configure = function configure(_ref) {
8662
- var _middleware = _ref.middleware,
9011
+
9012
+ // ============================================================================
9013
+ // Utility Types
9014
+ // ============================================================================
9015
+
9016
+ /** Capitalize first letter of a string type */
9017
+
9018
+ // ============================================================================
9019
+ // Hook Types
9020
+ // ============================================================================
9021
+
9022
+ /** Return type for hooks - [value, setter, extras] */
9023
+
9024
+ /** A hook with static methods for non-component usage */
9025
+
9026
+ /** Generate hook types from initial state - creates useFieldName for each field */
9027
+
9028
+ /** Domain hook for the entire slice state */
9029
+
9030
+ // ============================================================================
9031
+ // Selector Types
9032
+ // ============================================================================
9033
+
9034
+ /** Generate selector types from initial state - creates selectFieldName for each field */
9035
+
9036
+ // ============================================================================
9037
+ // Action Types
9038
+ // ============================================================================
9039
+
9040
+ /** Generate setter action types from initial state - creates setFieldName for each field */
9041
+
9042
+ /** Slice-level setter action */
9043
+
9044
+ /** Extract action types from custom reducers */
9045
+
9046
+ // ============================================================================
9047
+ // Extended Slice Type
9048
+ // ============================================================================
9049
+
9050
+ /** Extended slice with hooks, selectors, and properly typed actions */
9051
+
9052
+ // ============================================================================
9053
+ // Configure Options Types
9054
+ // ============================================================================
9055
+
9056
+ /** Configuration options for the store - reducer is NOT required */
9057
+
9058
+ // ============================================================================
9059
+ // RTK Config Types
9060
+ // ============================================================================
9061
+
9062
+ /** RTK-compatible configuration for custom reducers */
9063
+
9064
+ /** Astroglide-specific configuration overrides */
9065
+
9066
+ // ============================================================================
9067
+ // Configure Result Type
9068
+ // ============================================================================
9069
+
9070
+ /** Result returned from configure() */
9071
+
9072
+ var configure = function configure() {
9073
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
9074
+ _middleware = _ref.middleware,
8663
9075
  devTools = _ref.devTools,
8664
9076
  preloadedState = _ref.preloadedState,
8665
9077
  enhancers = _ref.enhancers,
8666
9078
  staticReducers = _objectWithoutProperties(_ref, _excluded);
9079
+ // Add a placeholder reducer if no static reducers provided
9080
+ // This prevents combineReducers({}) from throwing an error
9081
+ var hasStaticReducers = Object.keys(staticReducers).length > 0;
9082
+ var initialReducers = hasStaticReducers ? staticReducers : {
9083
+ __astroglide_init__: function __astroglide_init__() {
9084
+ var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
9085
+ return state;
9086
+ }
9087
+ };
8667
9088
  var store = configureStore({
8668
9089
  // @ts-ignore-next-line
8669
- reducer: combineReducers(staticReducers),
9090
+ reducer: combineReducers(initialReducers),
8670
9091
  middleware: function middleware(getDefaultMiddleware) {
8671
9092
  return [].concat(_toConsumableArray(typeof _middleware === "function" ? _middleware(getDefaultMiddleware) : _middleware || []), [injectableMiddleware]);
8672
9093
  },
@@ -8677,12 +9098,13 @@
8677
9098
  var _configureSelectors = configure$1(store),
8678
9099
  makePropertySelectorsFromSlice = _configureSelectors.makePropertySelectorsFromSlice;
8679
9100
  var injectSlice$1 = function injectSlice$1(slice) {
8680
- return injectSlice(store, staticReducers, slice);
9101
+ return injectSlice(store, initialReducers, slice);
8681
9102
  };
8682
9103
  var injectReducer$1 = function injectReducer$1(key, asyncReducer) {
8683
- return injectReducer(store, staticReducers, key, asyncReducer);
9104
+ return injectReducer(store, initialReducers, key, asyncReducer);
8684
9105
  };
8685
- var createAutomatedSlice = function createAutomatedSlice(sliceConfig, rtkConfig) {
9106
+ var createAutomatedSlice = function createAutomatedSlice(sliceConfig) {
9107
+ var rtkConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8686
9108
  var pluginData = {};
8687
9109
  map_1(sliceConfig.initialState, function (_item, key) {
8688
9110
  var item = _item; // cache it here to pull item -> value -> value -> value if multiple plugins are used...
@@ -8738,18 +9160,18 @@
8738
9160
  return action.payload;
8739
9161
  }
8740
9162
  }, sliceSetterKey, function (state, action) {
8741
- var _loop = function _loop(key) {
8742
- var actionType = "set".concat(upperFirst_1(key));
9163
+ var _loop = function _loop(_key) {
9164
+ var actionType = "set".concat(upperFirst_1(_key));
8743
9165
  var setter = setterReducers[actionType] || function (_state, _action) {
8744
- _state[key] = _action.payload;
9166
+ _state[_key] = _action.payload;
8745
9167
  };
8746
9168
  setter(state, {
8747
9169
  type: actionType,
8748
- payload: action.payload[key]
9170
+ payload: action.payload[_key]
8749
9171
  });
8750
9172
  };
8751
- for (var key in action.payload) {
8752
- _loop(key);
9173
+ for (var _key in action.payload) {
9174
+ _loop(_key);
8753
9175
  }
8754
9176
  }), sliceConfig.reducers || {})
8755
9177
  }));
@@ -8762,8 +9184,8 @@
8762
9184
  domainHookKey = domainHookKey.replace(/(^use)(.*)(Slice$)/, "$1$2_$3");
8763
9185
  }
8764
9186
  var getParams = function getParams() {
8765
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
8766
- args[_key] = arguments[_key];
9187
+ for (var _len = arguments.length, args = new Array(_len), _key2 = 0; _key2 < _len; _key2++) {
9188
+ args[_key2] = arguments[_key2];
8767
9189
  }
8768
9190
  var params = args;
8769
9191
  if (args.length === 1 && typeof args[0] === "function") {
@@ -8782,7 +9204,7 @@
8782
9204
 
8783
9205
  /* eslint-disable react-hooks/rules-of-hooks */
8784
9206
  hooks[domainHookKey] = function () {
8785
- return [reactRedux.useSelector(selectDomain), useAction(slice.actions[sliceSetterKey], undefined).apply(void 0, _toConsumableArray(getParams())),
9207
+ return [useSelector(selectDomain), useAction(slice.actions[sliceSetterKey], undefined).apply(void 0, _toConsumableArray(getParams())),
8786
9208
  // prop updater
8787
9209
  useAction(slice.actions.__override__slice__caution, undefined) // state overwriter
8788
9210
  ];
@@ -8802,16 +9224,24 @@
8802
9224
  injectSlice$1(slice);
8803
9225
  return slice;
8804
9226
  };
8805
- var astroglide = function astroglide(name, initialState) {
9227
+
9228
+ // Overload signatures for the astroglide/createSlice function
9229
+
9230
+ function astroglide(name) {
9231
+ var initialState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8806
9232
  var rtkConfig = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
8807
9233
  var astroglideConfigOverrides = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
8808
9234
  var shorthandParams = _typeof$1(name) === "object";
9235
+
9236
+ // Restore original parameter passing logic exactly
8809
9237
  var params = [].concat(_toConsumableArray(shorthandParams ? [name, initialState, rtkConfig] : [_objectSpread2$1(_objectSpread2$1({}, rtkConfig), {}, {
8810
9238
  name: name,
8811
9239
  initialState: initialState
8812
9240
  })]), [shorthandParams ? astroglideConfigOverrides : initialState]);
9241
+
9242
+ // @ts-ignore - params is dynamically constructed based on shorthand vs normal call
8813
9243
  return createAutomatedSlice.apply(void 0, _toConsumableArray(params));
8814
- };
9244
+ }
8815
9245
  return {
8816
9246
  createSlice: astroglide,
8817
9247
  astroglide: astroglide,
@@ -8822,6 +9252,8 @@
8822
9252
  };
8823
9253
  };
8824
9254
 
9255
+ // Export types for consumer usage
9256
+
8825
9257
  exports.addPlugin = addPlugin;
8826
9258
  exports.addPlugins = addPlugins;
8827
9259
  exports.configure = configure;