@tramvai/state 1.101.2 → 1.101.6
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/lib/index.es.js +11 -11
- package/lib/index.js +11 -11
- package/package.json +2 -2
package/lib/index.es.js
CHANGED
|
@@ -654,8 +654,8 @@ class Subscription {
|
|
|
654
654
|
}
|
|
655
655
|
}
|
|
656
656
|
|
|
657
|
-
const ConnectContext = createContext(null);
|
|
658
|
-
const ServerStateContext = createContext(null);
|
|
657
|
+
const ConnectContext = /* #__PURE__*/ createContext(null);
|
|
658
|
+
const ServerStateContext = /* #__PURE__*/ createContext(null);
|
|
659
659
|
|
|
660
660
|
const useConsumerContext = () => {
|
|
661
661
|
const context = useContext(ConnectContext);
|
|
@@ -718,7 +718,7 @@ function scheduling() {
|
|
|
718
718
|
return setTimeout;
|
|
719
719
|
}
|
|
720
720
|
|
|
721
|
-
const schedule = scheduling();
|
|
721
|
+
const schedule = /* #__PURE__*/ scheduling();
|
|
722
722
|
function useSelector(storesOrStore, selector, equalityFn = shallowEqual) {
|
|
723
723
|
invariant(selector, `You must pass a selector to useSelectors`);
|
|
724
724
|
const context = useConsumerContext();
|
|
@@ -794,22 +794,22 @@ selectorFactory,
|
|
|
794
794
|
{
|
|
795
795
|
// the func used to compute this HOC's displayName from the wrapped component's displayName.
|
|
796
796
|
// probably overridden by wrapper functions such as connect()
|
|
797
|
-
getDisplayName
|
|
797
|
+
getDisplayName = (name) => `ConnectAdvanced(${name})`,
|
|
798
798
|
// shown in error messages
|
|
799
799
|
// probably overridden by wrapper functions such as connect()
|
|
800
|
-
methodName,
|
|
800
|
+
methodName = 'connectAdvanced',
|
|
801
801
|
// stores to connect to
|
|
802
|
-
stores,
|
|
802
|
+
stores = [],
|
|
803
803
|
// determines whether this HOC subscribes to store changes
|
|
804
|
-
shouldHandleStateChanges,
|
|
804
|
+
shouldHandleStateChanges = true,
|
|
805
805
|
// use React's forwardRef to expose a ref of the wrapped component
|
|
806
|
-
forwardRef,
|
|
806
|
+
forwardRef = false,
|
|
807
807
|
// function used to schedule updates
|
|
808
|
-
schedule,
|
|
808
|
+
schedule = (fn) => fn(),
|
|
809
809
|
// is component and all toProps functions are pure, so they can be memoized
|
|
810
|
-
pure,
|
|
810
|
+
pure = true,
|
|
811
811
|
// additional options are passed through to the selectorFactory
|
|
812
|
-
...connectOptions }) {
|
|
812
|
+
...connectOptions } = {}) {
|
|
813
813
|
return function wrapWithConnect(WrappedComponent) {
|
|
814
814
|
if (process.env.NODE_ENV !== 'production') {
|
|
815
815
|
invariant(isValidElementType(WrappedComponent), `You must pass a component to the function returned by ` +
|
package/lib/index.js
CHANGED
|
@@ -676,8 +676,8 @@ class Subscription {
|
|
|
676
676
|
}
|
|
677
677
|
}
|
|
678
678
|
|
|
679
|
-
const ConnectContext = React.createContext(null);
|
|
680
|
-
const ServerStateContext = React.createContext(null);
|
|
679
|
+
const ConnectContext = /* #__PURE__*/ React.createContext(null);
|
|
680
|
+
const ServerStateContext = /* #__PURE__*/ React.createContext(null);
|
|
681
681
|
|
|
682
682
|
const useConsumerContext = () => {
|
|
683
683
|
const context = React.useContext(ConnectContext);
|
|
@@ -740,7 +740,7 @@ function scheduling() {
|
|
|
740
740
|
return setTimeout;
|
|
741
741
|
}
|
|
742
742
|
|
|
743
|
-
const schedule = scheduling();
|
|
743
|
+
const schedule = /* #__PURE__*/ scheduling();
|
|
744
744
|
function useSelector(storesOrStore, selector, equalityFn = shallowEqual__default["default"]) {
|
|
745
745
|
invariant__default["default"](selector, `You must pass a selector to useSelectors`);
|
|
746
746
|
const context = useConsumerContext();
|
|
@@ -816,22 +816,22 @@ selectorFactory,
|
|
|
816
816
|
{
|
|
817
817
|
// the func used to compute this HOC's displayName from the wrapped component's displayName.
|
|
818
818
|
// probably overridden by wrapper functions such as connect()
|
|
819
|
-
getDisplayName
|
|
819
|
+
getDisplayName = (name) => `ConnectAdvanced(${name})`,
|
|
820
820
|
// shown in error messages
|
|
821
821
|
// probably overridden by wrapper functions such as connect()
|
|
822
|
-
methodName,
|
|
822
|
+
methodName = 'connectAdvanced',
|
|
823
823
|
// stores to connect to
|
|
824
|
-
stores,
|
|
824
|
+
stores = [],
|
|
825
825
|
// determines whether this HOC subscribes to store changes
|
|
826
|
-
shouldHandleStateChanges,
|
|
826
|
+
shouldHandleStateChanges = true,
|
|
827
827
|
// use React's forwardRef to expose a ref of the wrapped component
|
|
828
|
-
forwardRef,
|
|
828
|
+
forwardRef = false,
|
|
829
829
|
// function used to schedule updates
|
|
830
|
-
schedule,
|
|
830
|
+
schedule = (fn) => fn(),
|
|
831
831
|
// is component and all toProps functions are pure, so they can be memoized
|
|
832
|
-
pure,
|
|
832
|
+
pure = true,
|
|
833
833
|
// additional options are passed through to the selectorFactory
|
|
834
|
-
...connectOptions }) {
|
|
834
|
+
...connectOptions } = {}) {
|
|
835
835
|
return function wrapWithConnect(WrappedComponent) {
|
|
836
836
|
if (process.env.NODE_ENV !== 'production') {
|
|
837
837
|
invariant__default["default"](reactIs.isValidElementType(WrappedComponent), `You must pass a component to the function returned by ` +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/state",
|
|
3
|
-
"version": "1.101.
|
|
3
|
+
"version": "1.101.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@tinkoff/react-hooks": "0.0.24",
|
|
22
22
|
"@tinkoff/utils": "^2.1.2",
|
|
23
|
-
"@tramvai/types-actions-state-context": "1.101.
|
|
23
|
+
"@tramvai/types-actions-state-context": "1.101.6",
|
|
24
24
|
"@types/hoist-non-react-statics": "^3.3.1",
|
|
25
25
|
"invariant": "^2.2.4",
|
|
26
26
|
"react-is": ">=17",
|