@octanejs/redux-toolkit 0.1.57 → 0.1.58
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octanejs/redux-toolkit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.58",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -34,18 +34,18 @@
|
|
|
34
34
|
"./query/react": "./src/query/react/index.ts"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@octanejs/redux": "0.1.
|
|
37
|
+
"@octanejs/redux": "0.1.60",
|
|
38
38
|
"@reduxjs/toolkit": "^2.12.0",
|
|
39
39
|
"redux": "^5.0.1",
|
|
40
40
|
"reselect": "5.2.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"octane": "^0.
|
|
43
|
+
"octane": "^0.11.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@tsrx/react": "^0.
|
|
46
|
+
"@tsrx/react": "^0.4.5",
|
|
47
47
|
"esbuild": "^0.28.1",
|
|
48
|
-
"octane": "0.
|
|
48
|
+
"octane": "0.11.0",
|
|
49
49
|
"react": "19.2.7",
|
|
50
50
|
"react-dom": "19.2.7",
|
|
51
51
|
"react-redux": "9.3.0",
|
|
@@ -15,11 +15,13 @@ export function ApiProvider(props: {
|
|
|
15
15
|
const context = props.context || ReactReduxContext;
|
|
16
16
|
const existingContext = useContext(context);
|
|
17
17
|
if (existingContext) {
|
|
18
|
-
throw new Error(
|
|
18
|
+
throw new Error(
|
|
19
|
+
'Existing Redux context detected. If you already have a store set up, please use the traditional Redux setup.',
|
|
20
|
+
);
|
|
19
21
|
}
|
|
20
22
|
|
|
21
|
-
const [store] = useState(
|
|
22
|
-
|
|
23
|
+
const [store] = useState(() =>
|
|
24
|
+
configureStore({
|
|
23
25
|
reducer: {
|
|
24
26
|
[props.api.reducerPath]: props.api.reducer,
|
|
25
27
|
},
|
|
@@ -28,11 +30,14 @@ export function ApiProvider(props: {
|
|
|
28
30
|
);
|
|
29
31
|
|
|
30
32
|
useEffect(
|
|
31
|
-
() =>
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
() =>
|
|
34
|
+
props.setupListeners === false
|
|
35
|
+
? undefined
|
|
36
|
+
: setupListeners(store.dispatch, props.setupListeners),
|
|
34
37
|
[props.setupListeners, store.dispatch],
|
|
35
38
|
);
|
|
36
39
|
|
|
37
|
-
<Provider store={store} context={context}>
|
|
40
|
+
<Provider store={store} context={context}>
|
|
41
|
+
{props.children}
|
|
42
|
+
</Provider>
|
|
38
43
|
}
|