@coaction/redux 2.1.0 → 3.1.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/README.md +2 -0
- package/dist/index.js +3 -3
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
 [](https://www.npmjs.com/package/@coaction/redux) 
|
|
4
4
|
|
|
5
|
+
[English documentation](https://coactionjs.github.io/coaction/en/docs/) · [中文文档](https://coactionjs.github.io/coaction/zh/docs/)
|
|
6
|
+
|
|
5
7
|
A Coaction integration tool for Redux Toolkit.
|
|
6
8
|
|
|
7
9
|
## Installation
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
//#endregion
|
|
3
|
-
let
|
|
3
|
+
let coaction_adapter = require("coaction/adapter");
|
|
4
4
|
//#region packages/coaction-redux/src/index.ts
|
|
5
5
|
const COACTION_REDUX_REPLACE = "@@coaction/redux/replace";
|
|
6
6
|
const isUnsafeKey = (key) => typeof key === "string" && (key === "__proto__" || key === "prototype" || key === "constructor");
|
|
@@ -60,14 +60,14 @@ const bindRedux = (reduxStore) => {
|
|
|
60
60
|
const originalGetState = reduxStore.getState.bind(reduxStore);
|
|
61
61
|
let isReduxUpdating = false;
|
|
62
62
|
let isCoactionUpdating = false;
|
|
63
|
-
const bindState = (0,
|
|
63
|
+
const bindState = (0, coaction_adapter.createBinder)({
|
|
64
64
|
handleStore: (coactionStore, rawState, state, internal) => {
|
|
65
65
|
if (coactionStore.share === "client") throw new Error("client redux store cannot be updated");
|
|
66
66
|
const unsubscribe = reduxStore.subscribe(() => {
|
|
67
67
|
if (isCoactionUpdating) return;
|
|
68
68
|
isReduxUpdating = true;
|
|
69
69
|
try {
|
|
70
|
-
(0,
|
|
70
|
+
(0, coaction_adapter.replaceExternalStoreState)(coactionStore, internal, originalGetState(), { syncImmutable: false });
|
|
71
71
|
} finally {
|
|
72
72
|
isReduxUpdating = false;
|
|
73
73
|
}
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coaction/redux",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "A Coaction integration tool for Redux Toolkit",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"coaction",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@reduxjs/toolkit": "^2.10.1",
|
|
49
|
-
"coaction": "
|
|
49
|
+
"coaction": "3.1.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@reduxjs/toolkit": "^2.0.0",
|
|
53
|
-
"coaction": "
|
|
53
|
+
"coaction": "^3.1.0"
|
|
54
54
|
},
|
|
55
55
|
"authors": [
|
|
56
56
|
"Michael Lin <unadlib@gmail.com> (https://github.com/unadlib)"
|