@coaction/redux 2.0.0 → 3.0.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 CHANGED
@@ -1,17 +1,17 @@
1
1
  # @coaction/redux
2
2
 
3
- ![Node CI](https://github.com/coactionjs/coaction/workflows/Node%20CI/badge.svg)
4
- [![npm](https://img.shields.io/npm/v/@coaction/redux.svg)](https://www.npmjs.com/package/@coaction/redux)
5
- ![license](https://img.shields.io/npm/l/@coaction/redux)
3
+ ![Node CI](https://github.com/coactionjs/coaction/workflows/Node%20CI/badge.svg) [![npm](https://img.shields.io/npm/v/@coaction/redux.svg)](https://www.npmjs.com/package/@coaction/redux) ![license](https://img.shields.io/npm/l/@coaction/redux)
4
+
5
+ [English documentation](https://coactionjs.github.io/coaction/en/docs/) · [中文文档](https://coactionjs.github.io/coaction/zh/docs/)
6
6
 
7
7
  A Coaction integration tool for Redux Toolkit.
8
8
 
9
9
  ## Installation
10
10
 
11
- You can install it via npm, yarn or pnpm.
11
+ Install it with pnpm:
12
12
 
13
13
  ```sh
14
- npm install coaction @coaction/redux @reduxjs/toolkit
14
+ pnpm add coaction @coaction/redux @reduxjs/toolkit
15
15
  ```
16
16
 
17
17
  ## Usage
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  //#endregion
3
- let coaction = require("coaction");
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, coaction.createBinder)({
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, coaction.replaceExternalStoreState)(coactionStore, internal, originalGetState(), { syncImmutable: false });
70
+ (0, coaction_adapter.replaceExternalStoreState)(coactionStore, internal, originalGetState(), { syncImmutable: false });
71
71
  } finally {
72
72
  isReduxUpdating = false;
73
73
  }
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { createBinder, replaceExternalStoreState } from "coaction";
1
+ import { createBinder, replaceExternalStoreState } from "coaction/adapter";
2
2
  export * from "@reduxjs/toolkit";
3
3
  //#endregion
4
4
  //#region packages/coaction-redux/src/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coaction/redux",
3
- "version": "2.0.0",
3
+ "version": "3.0.0",
4
4
  "description": "A Coaction integration tool for Redux Toolkit",
5
5
  "keywords": [
6
6
  "coaction",
@@ -28,9 +28,14 @@
28
28
  "types": "dist/index.d.ts",
29
29
  "exports": {
30
30
  ".": {
31
- "types": "./dist/index.d.ts",
32
- "import": "./dist/index.mjs",
33
- "require": "./dist/index.js",
31
+ "import": {
32
+ "types": "./dist/index.d.mts",
33
+ "default": "./dist/index.mjs"
34
+ },
35
+ "require": {
36
+ "types": "./dist/index.d.ts",
37
+ "default": "./dist/index.js"
38
+ },
34
39
  "default": "./dist/index.mjs"
35
40
  },
36
41
  "./package.json": "./package.json"
@@ -41,11 +46,11 @@
41
46
  },
42
47
  "devDependencies": {
43
48
  "@reduxjs/toolkit": "^2.10.1",
44
- "coaction": "2.0.0"
49
+ "coaction": "3.0.0"
45
50
  },
46
51
  "peerDependencies": {
47
52
  "@reduxjs/toolkit": "^2.0.0",
48
- "coaction": "^2.0.0"
53
+ "coaction": "^3.0.0"
49
54
  },
50
55
  "authors": [
51
56
  "Michael Lin <unadlib@gmail.com> (https://github.com/unadlib)"