@coaction/pinia 0.1.0 → 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 +44 -0
  2. package/package.json +4 -4
package/README.md ADDED
@@ -0,0 +1,44 @@
1
+ # @coaction/pinia
2
+
3
+ ![Node CI](https://github.com/unadlib/coaction/workflows/Node%20CI/badge.svg)
4
+ [![npm](https://img.shields.io/npm/v/@coaction/pinia.svg)](https://www.npmjs.com/package/@coaction/pinia)
5
+ ![license](https://img.shields.io/npm/l/@coaction/pinia)
6
+
7
+ A Coaction integration tool for Pinia
8
+
9
+ ## Installation
10
+
11
+ You can install it via npm, yarn or pnpm.
12
+
13
+ ```sh
14
+ npm install coaction @coaction/pinia
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ```js
20
+ import { create } from 'coaction';
21
+ import { bindPinia } from '@coaction/pinia';
22
+ import { defineStore } from 'pinia';
23
+
24
+ const useStore = create(() =>
25
+ defineStore(
26
+ 'test',
27
+ bindPinia({
28
+ state: () => ({ count: 0 }),
29
+ getters: {
30
+ double: (state) => state.count * 2
31
+ },
32
+ actions: {
33
+ increment(state) {
34
+ state.count += 1;
35
+ }
36
+ }
37
+ })
38
+ )
39
+ );
40
+ ```
41
+
42
+ ## Documentation
43
+
44
+ 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/pinia",
3
- "version": "0.1.0",
4
- "description": "Coaction tools for Pinia",
3
+ "version": "0.1.4",
4
+ "description": "A Coaction integration tool for Pinia",
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
  "mutative": "^1.1.0",
52
52
  "pinia": "^2.0"
53
53
  },
@@ -57,7 +57,7 @@
57
57
  }
58
58
  },
59
59
  "devDependencies": {
60
- "coaction": "*",
60
+ "coaction": "^0.1.4",
61
61
  "mutative": "^1.1.0",
62
62
  "pinia": "^2.2.4"
63
63
  },