@coaction/mobx 0.0.1 → 0.1.4

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.
Files changed (2) hide show
  1. package/README.md +42 -0
  2. package/package.json +4 -4
package/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # @coaction/mobx
2
+
3
+ ![Node CI](https://github.com/unadlib/coaction/workflows/Node%20CI/badge.svg)
4
+ [![npm](https://img.shields.io/npm/v/@coaction/mobx.svg)](https://www.npmjs.com/package/@coaction/mobx)
5
+ ![license](https://img.shields.io/npm/l/@coaction/mobx)
6
+
7
+ A Coaction integration tool for MobX
8
+
9
+ ## Installation
10
+
11
+ You can install it via npm, yarn or pnpm.
12
+
13
+ ```sh
14
+ npm install coaction @coaction/mobx
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ```js
20
+ import { create } from 'coaction';
21
+ import { bindMobx } from '@coaction/mobx';
22
+ import { makeAutoObservable } from 'mobx';
23
+
24
+ const useStore = create(() =>
25
+ makeAutoObservable(
26
+ bindMobx({
27
+ name: 'test',
28
+ count: 0,
29
+ get double() {
30
+ return this.count * 2;
31
+ },
32
+ increment() {
33
+ this.count += 1;
34
+ }
35
+ })
36
+ )
37
+ );
38
+ ```
39
+
40
+ ## Documentation
41
+
42
+ You can find the documentation [here](https://github.com/unadlib/coaction).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coaction/mobx",
3
- "version": "0.0.1",
4
- "description": "Coaction tools for MobX",
3
+ "version": "0.1.4",
4
+ "description": "A Coaction integration tool for MobX",
5
5
  "keywords": [
6
6
  "state",
7
7
  "coaction",
@@ -47,7 +47,7 @@
47
47
  ]
48
48
  },
49
49
  "peerDependencies": {
50
- "coaction": "^0.1.0",
50
+ "coaction": "^0.1.4",
51
51
  "mobx": "^6.13.2",
52
52
  "mutative": "^1.1.0",
53
53
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
@@ -63,7 +63,7 @@
63
63
  "@types/react": "^17.0.43",
64
64
  "@types/react-dom": "^17.0.14",
65
65
  "@types/use-sync-external-store": "^0.0.3",
66
- "coaction": "*",
66
+ "coaction": "^0.1.4",
67
67
  "jsdom": "^25.0.1",
68
68
  "jsdom-global": "^3.0.2",
69
69
  "mobx": "^6.13.2",