vue-act-master 0.10.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/CHANGELOG.md ADDED
@@ -0,0 +1,270 @@
1
+ ### Changelog
2
+
3
+ All notable changes to this project will be documented in this file. Dates are displayed in UTC.
4
+
5
+ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
+
7
+ #### [v1.3.3](https://github.com/avil13/vue-act-master/compare/v1.0.3...v1.3.3)
8
+
9
+ > 9 January 2021
10
+
11
+ - build(deps): bump node-notifier from 8.0.0 to 8.0.1 [`#13`](https://github.com/avil13/vue-act-master/pull/13)
12
+ - build(deps): bump ini from 1.3.5 to 1.3.8 [`#10`](https://github.com/avil13/vue-act-master/pull/10)
13
+ - Create LICENSE [`#8`](https://github.com/avil13/vue-act-master/pull/8)
14
+ - Bump node-fetch from 2.6.0 to 2.6.1 in /packages/vue-act-master [`#7`](https://github.com/avil13/vue-act-master/pull/7)
15
+ - feat(act-master): CancelledAct method "is" [`fcd75ab`](https://github.com/avil13/vue-act-master/commit/fcd75abe135a4c61881f0b11766a56f45d1a9678)
16
+ - feat(vue-act-master): updated act-master to v1.1.0 [`eb58a61`](https://github.com/avil13/vue-act-master/commit/eb58a61261f0341b2a50b05bca81b4469344b3c1)
17
+ - feat(docs): vitepress documentation [`14998c2`](https://github.com/avil13/vue-act-master/commit/14998c2981bcf1572f81350f26c4b2f8153d1491)
18
+
19
+ ### [v1.0.3](https://github.com/avil13/vue-act-master/compare/v0.9.8...v1.0.3)
20
+
21
+ > 20 October 2020
22
+
23
+ #### [v0.9.8](https://github.com/avil13/vue-act-master/compare/v0.9.6...v0.9.8)
24
+
25
+ > 6 July 2021
26
+
27
+ - build(deps): bump ws from 7.4.5 to 7.5.0 [`#17`](https://github.com/avil13/vue-act-master/pull/17)
28
+ - build(deps): bump postcss from 7.0.35 to 7.0.36 [`#18`](https://github.com/avil13/vue-act-master/pull/18)
29
+ - fix(vue-act-master): fix ActSubscribe decorator [`582ff24`](https://github.com/avil13/vue-act-master/commit/582ff245fea82ffa822ff0236a7edb53598234b4)
30
+ - feat(act-master): bump version 1.4.1 [`efcd46a`](https://github.com/avil13/vue-act-master/commit/efcd46a5b251524ff5ea5a9f9b759bd9075ebf2c)
31
+ - feat(act-master): Added error handler on validation error & fix test-utils reset bug [`525660c`](https://github.com/avil13/vue-act-master/commit/525660c300065b2e6a93f9f459782c445935cf16)
32
+
33
+ #### [v0.9.6](https://github.com/avil13/vue-act-master/compare/v0.9.3...v0.9.6)
34
+
35
+ > 20 June 2021
36
+
37
+ - feat(vue-act-master): nuxt fix module 4 [`8d86d18`](https://github.com/avil13/vue-act-master/commit/8d86d1866f08d2338132af70ca0ef2f1bb483526)
38
+ - docs: vue-act-master doc nuxtjs [`9af0608`](https://github.com/avil13/vue-act-master/commit/9af0608e03eb2fb3bfa5e435108c9e7d2e5d24bf)
39
+ - feat(vue-act-master): nuxt fix module 3 [`7d22c89`](https://github.com/avil13/vue-act-master/commit/7d22c89723218bee95c0d4da0fbe027c470001f9)
40
+
41
+ #### [v0.9.3](https://github.com/avil13/vue-act-master/compare/v0.9.2...v0.9.3)
42
+
43
+ > 8 May 2021
44
+
45
+ - feat(vue-act-master): nuxt fix module 2 [`41a2444`](https://github.com/avil13/vue-act-master/commit/41a2444bdd01326a4e77b1dad1bcf1d11be23493)
46
+
47
+ #### [v0.9.2](https://github.com/avil13/vue-act-master/compare/v0.9.1...v0.9.2)
48
+
49
+ > 8 May 2021
50
+
51
+ - docs: vue-act-master doc update [`98e6843`](https://github.com/avil13/vue-act-master/commit/98e6843bd68bbcd317b4938258e122fb6d6711d0)
52
+ - feat(vue-act-master): nuxt fix module [`5ddf0a0`](https://github.com/avil13/vue-act-master/commit/5ddf0a0ccdaab523d0284659451de18332446090)
53
+
54
+ #### [v0.9.1](https://github.com/avil13/vue-act-master/compare/v0.9.0...v0.9.1)
55
+
56
+ > 7 May 2021
57
+
58
+ - build(deps): bump ssri from 8.0.0 to 8.0.1 [`#14`](https://github.com/avil13/vue-act-master/pull/14)
59
+ - docs: up vitepress [`29a78fa`](https://github.com/avil13/vue-act-master/commit/29a78fa474c9be104aceaf13d7bf7bde43661b9f)
60
+ - chore(act-master): optimie build size [`dd3f8b1`](https://github.com/avil13/vue-act-master/commit/dd3f8b17b666bea9469e5b6b3482eed076971a78)
61
+ - docs(tip): added websocket example [`f3632cf`](https://github.com/avil13/vue-act-master/commit/f3632cf1d8a7c1f6ec69b1ab4b0fde2e18d73a60)
62
+
63
+ #### [v0.9.0](https://github.com/avil13/vue-act-master/compare/v0.8.8...v0.9.0)
64
+
65
+ > 9 January 2021
66
+
67
+ - feat(act-master): change listenera and action container to the Map [`f17df13`](https://github.com/avil13/vue-act-master/commit/f17df13ece0e5b9a7528811885ab692e7513a4ca)
68
+ - fix: readme [`abfbc54`](https://github.com/avil13/vue-act-master/commit/abfbc5464654a4619533d22cc46d59437a14fc0d)
69
+ - fix: repo in package.json [`2484a1f`](https://github.com/avil13/vue-act-master/commit/2484a1f9db9a1b5255b70c8104119b2ff3c99609)
70
+
71
+ #### [v0.8.8](https://github.com/avil13/vue-act-master/compare/v0.8.6...v0.8.8)
72
+
73
+ > 9 January 2021
74
+
75
+ - build(deps): bump node-notifier from 8.0.0 to 8.0.1 [`#13`](https://github.com/avil13/vue-act-master/pull/13)
76
+ - feat(docs): vitepress documentation [`14998c2`](https://github.com/avil13/vue-act-master/commit/14998c2981bcf1572f81350f26c4b2f8153d1491)
77
+ - feat(docs): fixes [`ef6ed76`](https://github.com/avil13/vue-act-master/commit/ef6ed7680198533f09f0dd2bf33cc69071831085)
78
+ - docs: logo and icons [`1920bae`](https://github.com/avil13/vue-act-master/commit/1920bae48f472c7fb444db13b6606016655433bc)
79
+
80
+ #### [v0.8.6](https://github.com/avil13/vue-act-master/compare/v0.8.5...v0.8.6)
81
+
82
+ > 29 December 2020
83
+
84
+ - feat(act-master): added validateInput method [`08182c9`](https://github.com/avil13/vue-act-master/commit/08182c9f3825a64e50a6bd66c01f90eea896ec08)
85
+ - feat(vue-act-master): up act-master to 1.3.0 [`7997f94`](https://github.com/avil13/vue-act-master/commit/7997f94769210de66259bf5091ecfcf4071f5b6c)
86
+ - feat(act-master): bump version 1.3.0 [`b96c8ab`](https://github.com/avil13/vue-act-master/commit/b96c8ab86a03aa9286d3624466f70cc4f3743fb8)
87
+
88
+ #### [v0.8.5](https://github.com/avil13/vue-act-master/compare/v0.8.4...v0.8.5)
89
+
90
+ > 14 December 2020
91
+
92
+ - build(deps): bump ini from 1.3.5 to 1.3.8 [`#10`](https://github.com/avil13/vue-act-master/pull/10)
93
+ - Create LICENSE [`#8`](https://github.com/avil13/vue-act-master/pull/8)
94
+ - feat(vue-act-master): auto-unsubscribe in vue3 [`41d3e3d`](https://github.com/avil13/vue-act-master/commit/41d3e3d9082de77a8419114448ec75fd43f632eb)
95
+ - feat(act-master): version v1.2.2 [`8c889da`](https://github.com/avil13/vue-act-master/commit/8c889da733b4dec323463203d20e56557bdfc60c)
96
+ - docs(vue-act-master): fix changelog [`b1ffd9b`](https://github.com/avil13/vue-act-master/commit/b1ffd9bef98d3f02f0ac7420544c78435cab01c6)
97
+
98
+ #### [v0.8.4](https://github.com/avil13/vue-act-master/compare/v0.8.3...v0.8.4)
99
+
100
+ > 5 November 2020
101
+
102
+ - feat(act-master): fixed test-utils loading & added min version [`abb6b99`](https://github.com/avil13/vue-act-master/commit/abb6b998b45f015243ea93cd5daadd90c500f323)
103
+ - fix(vue-act-master): version 0.8.3 [`df13fd7`](https://github.com/avil13/vue-act-master/commit/df13fd71b7e0a2aaa401439320e3e6f0e2b4063f)
104
+ - feat(act-master): bump version 1.2.1 [`106afa3`](https://github.com/avil13/vue-act-master/commit/106afa325a0b45efc8e6bb0947c1bb3efc5a3ac0)
105
+
106
+ #### [v0.8.3](https://github.com/avil13/vue-act-master/compare/v0.8.2...v0.8.3)
107
+
108
+ > 4 November 2020
109
+
110
+ - feat(vue-act-master): added test-utils [`81e0ecb`](https://github.com/avil13/vue-act-master/commit/81e0ecbf5750cfaf6ba101f989c08988051edcce)
111
+ - feat(vue-act-master): bump version to v0.8.2 [`d642b67`](https://github.com/avil13/vue-act-master/commit/d642b67cbfac40ae8d052b54c1a6e9c774d93ade)
112
+
113
+ #### [v0.8.2](https://github.com/avil13/vue-act-master/compare/v0.8.1...v0.8.2)
114
+
115
+ > 4 November 2020
116
+
117
+ - feat(act-master): added ActTest - helper class for unit tests [`5fa71eb`](https://github.com/avil13/vue-act-master/commit/5fa71eb6306de2267993cbf510fffb764cc06b64)
118
+ - docs(vue-act-master): updated README & up version act-master to 1.2.0 [`8d5bc90`](https://github.com/avil13/vue-act-master/commit/8d5bc90ed2e589242813c34cad4fc59d0ec23223)
119
+ - feat(act-master): bump version 1.2.0 [`fe78d07`](https://github.com/avil13/vue-act-master/commit/fe78d070497b4e65833e354a3284c36722fd1b8a)
120
+
121
+ #### [v0.8.1](https://github.com/avil13/vue-act-master/compare/v0.7.1...v0.8.1)
122
+
123
+ > 3 November 2020
124
+
125
+ - feat(vue-act-master): wip - ActSubscribe decorator [`d86825a`](https://github.com/avil13/vue-act-master/commit/d86825abe690e8b4607e57807cf4d5bbfc3bb29e)
126
+ - feat(vue-act-master): updated act-master to v1.1.2 [`59060b4`](https://github.com/avil13/vue-act-master/commit/59060b4e93104183068edd35cf079819ebf46ba1)
127
+ - docs(vue-act-master): updated README [`ecfa39c`](https://github.com/avil13/vue-act-master/commit/ecfa39c249955f8f501ac55182f595e293b4ff73)
128
+
129
+ #### [v0.7.1](https://github.com/avil13/vue-act-master/compare/v0.7.0...v0.7.1)
130
+
131
+ > 3 November 2020
132
+
133
+ - feat(vue-act-master): updated act-master to v1.1.0 [`eb58a61`](https://github.com/avil13/vue-act-master/commit/eb58a61261f0341b2a50b05bca81b4469344b3c1)
134
+ - feat(act-master): eventAction arguments list [`801f3bb`](https://github.com/avil13/vue-act-master/commit/801f3bbeb270774af5da0bc14e221778890c3e48)
135
+ - feat(vue-act-master): updated act-master to v1.1.1 [`52e26e5`](https://github.com/avil13/vue-act-master/commit/52e26e5878263f94a93a9b3c5ad8a82098cfbcb2)
136
+
137
+ #### [v0.7.0](https://github.com/avil13/vue-act-master/compare/v0.6.4...v0.7.0)
138
+
139
+ > 30 October 2020
140
+
141
+ - feat(vue-act-master): updated act-master to v1.1.0 [`a392f75`](https://github.com/avil13/vue-act-master/commit/a392f758779e2f567f8c1d9dcabb35e04d17b8db)
142
+ - feat(act-master): added commitezen [`0f335d4`](https://github.com/avil13/vue-act-master/commit/0f335d4e85b5ef7229659da0603af543a810df72)
143
+ - feat(act-master): added "di" option and tests for constructor options [`f5549a5`](https://github.com/avil13/vue-act-master/commit/f5549a588d7adfa1e41fd888e8469f9d05848e8c)
144
+
145
+ #### [v0.6.4](https://github.com/avil13/vue-act-master/compare/v0.6.3...v0.6.4)
146
+
147
+ > 29 October 2020
148
+
149
+ - feat(act-master): added "di" option and tests for constructor options
150
+ - feat(vue-act-master): link to example page [`16049dc`](https://github.com/avil13/vue-act-master/commit/16049dceeeb5e4bcb1594b6d1d6683919ebd48af)
151
+ - feat(vue-act-master): changelog [`77c6ddb`](https://github.com/avil13/vue-act-master/commit/77c6ddb541a07b62f27db6bdbc32eaf6d9a20829)
152
+
153
+ #### [v0.6.3](https://github.com/avil13/vue-act-master/compare/v0.6.1...v0.6.3)
154
+
155
+ > 28 October 2020
156
+
157
+ - feat(act-master): CancelledAct method "is" [`fcd75ab`](https://github.com/avil13/vue-act-master/commit/fcd75abe135a4c61881f0b11766a56f45d1a9678)
158
+ - fear(example): added example page [`c90d326`](https://github.com/avil13/vue-act-master/commit/c90d326dcad396ae7075c646404a528437bd3a2b)
159
+ - feat(act-master): build script fixed [`8d6c25a`](https://github.com/avil13/vue-act-master/commit/8d6c25a885986bcd8e268917538f208e5a2b538d)
160
+
161
+ #### [v0.6.1](https://github.com/avil13/vue-act-master/compare/v0.6.0...v0.6.1)
162
+
163
+ > 28 October 2020
164
+
165
+ - feat: update changelog command [`5075673`](https://github.com/avil13/vue-act-master/commit/50756734b83cf589d4858ab4a8e34d39d9a33719)
166
+ - . [`140990e`](https://github.com/avil13/vue-act-master/commit/140990e33785b66b5d5d80ab081cb75a2426fd25)
167
+ - chore: root repo scripts [`2607e3c`](https://github.com/avil13/vue-act-master/commit/2607e3c99b2d4cd241d1af383bf90dc84e93b078)
168
+
169
+ #### [v0.6.0](https://github.com/avil13/vue-act-master/compare/v0.5.0...v0.6.0)
170
+
171
+ > 25 October 2020
172
+
173
+ - Bump node-fetch from 2.6.0 to 2.6.1 in /packages/vue-act-master [`#7`](https://github.com/avil13/vue-act-master/pull/7)
174
+ - feat: add vue3 support [`e0281f3`](https://github.com/avil13/vue-act-master/commit/e0281f3fe03e14d7c1a72edecf06664442f7ce67)
175
+
176
+ #### [v0.5.0](https://github.com/avil13/vue-act-master/compare/v0.3.0...v0.5.0)
177
+
178
+ > 20 October 2020
179
+
180
+ - wip: chrome-devtools [`f336e5d`](https://github.com/avil13/vue-act-master/commit/f336e5d0b3ac168c5c01390e8e4aa6c0fa18f9b5)
181
+ - feat: the division into packages 3 [`4188460`](https://github.com/avil13/vue-act-master/commit/4188460ef7c12800b99ca5dd603136078046dc9d)
182
+ - feat: splitting a package into a mono repository [`1508bd7`](https://github.com/avil13/vue-act-master/commit/1508bd7ab1e3ccd2ffa39a9e1f4e9613c4de7d42)
183
+
184
+ #### [v0.3.0](https://github.com/avil13/vue-act-master/compare/v0.2.1...v0.3.0)
185
+
186
+ > 17 August 2020
187
+
188
+ - feat: added Emit decorator [`8d43ca7`](https://github.com/avil13/vue-act-master/commit/8d43ca7aeddc8511ffea3ad978bad12d97b3ff05)
189
+ - feat: added auto-changelog [`5a7a377`](https://github.com/avil13/vue-act-master/commit/5a7a37780b7d743e0f838627f39e4b614cb6f6db)
190
+
191
+ #### [v0.2.1](https://github.com/avil13/vue-act-master/compare/v0.2.0...v0.2.1)
192
+
193
+ > 16 August 2020
194
+
195
+ - feat: removal of unnecessary code [`66b4021`](https://github.com/avil13/vue-act-master/commit/66b4021cfc20b86e185a16ae879702231026b192)
196
+ - fix: fixed useDI method name [`3189c9f`](https://github.com/avil13/vue-act-master/commit/3189c9f355498bec11c5277d490fbc136f005f95)
197
+
198
+ #### [v0.2.0](https://github.com/avil13/vue-act-master/compare/v0.1.2...v0.2.0)
199
+
200
+ > 15 August 2020
201
+
202
+ - feat: update dependencies [`#6`](https://github.com/avil13/vue-act-master/pull/6)
203
+ - Bump elliptic from 6.5.2 to 6.5.3 [`#5`](https://github.com/avil13/vue-act-master/pull/5)
204
+ - feat: added UseDI decorator [`3152f7e`](https://github.com/avil13/vue-act-master/commit/3152f7e7a0d9565b2fad1059e5c0ec60eb560a8e)
205
+
206
+ #### [v0.1.2](https://github.com/avil13/vue-act-master/compare/v0.1.1...v0.1.2)
207
+
208
+ > 31 July 2020
209
+
210
+ - updated README [`a6d2c5a`](https://github.com/avil13/vue-act-master/commit/a6d2c5afb6074d23c72802dc398566502bd2a3d7)
211
+ - chore: change the name properties [`f55920f`](https://github.com/avil13/vue-act-master/commit/f55920f219be64e5589336a31565f0bff3ae62fe)
212
+
213
+ #### [v0.1.1](https://github.com/avil13/vue-act-master/compare/v0.1.0...v0.1.1)
214
+
215
+ > 21 May 2020
216
+
217
+ - fix useEmit cases [`d9673ea`](https://github.com/avil13/vue-act-master/commit/d9673ea9257e3117c393ca6193824a62c7ceb81e)
218
+
219
+ #### [v0.1.0](https://github.com/avil13/vue-act-master/compare/v0.0.11...v0.1.0)
220
+
221
+ > 16 May 2020
222
+
223
+ - Added
- DI
1
- useEmit
2
- debounce
224
+ - wip [`e72a93d`](https://github.com/avil13/vue-act-master/commit/e72a93d8d8db49cf9cb987013bccb4bb43aadcf2)
225
+
226
+ #### [v0.0.11](https://github.com/avil13/vue-act-master/compare/v0.0.10...v0.0.11)
227
+
228
+ > 3 May 2020
229
+
230
+ - emitAction fix [`8f9c178`](https://github.com/avil13/vue-act-master/commit/8f9c17804dd3b9bfe8a42b483834d3f339bb11d8)
231
+
232
+ #### [v0.0.10](https://github.com/avil13/vue-act-master/compare/v0.0.9...v0.0.10)
233
+
234
+ > 3 May 2020
235
+
236
+ - add emit and change subscribe [`e9e0fdf`](https://github.com/avil13/vue-act-master/commit/e9e0fdfd8ce032c1abc4e6a6f0a66229139fba84)
237
+
238
+ #### [v0.0.9](https://github.com/avil13/vue-act-master/compare/v0.0.8...v0.0.9)
239
+
240
+ > 3 May 2020
241
+
242
+ - add setState method [`7a006b6`](https://github.com/avil13/vue-act-master/commit/7a006b6018d2f18c2dc2f2725354f608de564b23)
243
+
244
+ #### [v0.0.8](https://github.com/avil13/vue-act-master/compare/v0.0.7...v0.0.8)
245
+
246
+ > 3 May 2020
247
+
248
+ - states [`e6cde84`](https://github.com/avil13/vue-act-master/commit/e6cde846ed32b2ae0efe53d0e921d4d06cec6dcc)
249
+
250
+ #### [v0.0.7](https://github.com/avil13/vue-act-master/compare/v0.0.6...v0.0.7)
251
+
252
+ > 2 May 2020
253
+
254
+ - useVue method [`01d8a41`](https://github.com/avil13/vue-act-master/commit/01d8a41a26841707be635c1614f3faeac770c46e)
255
+
256
+ #### [v0.0.6](https://github.com/avil13/vue-act-master/compare/v0.0.2...v0.0.6)
257
+
258
+ > 2 May 2020
259
+
260
+ - wip [`fb7b995`](https://github.com/avil13/vue-act-master/commit/fb7b995e039c7ea3ff46d075d32eebd611bcaca6)
261
+ - remove saga [`20e292c`](https://github.com/avil13/vue-act-master/commit/20e292cf06b327e8e1135272d02c9bd606020d41)
262
+ - nuxt [`05192bb`](https://github.com/avil13/vue-act-master/commit/05192bb754fc53dc8378e4e2dcff1496f6431221)
263
+
264
+ #### v0.0.2
265
+
266
+ > 2 April 2020
267
+
268
+ - init [`b3fea4f`](https://github.com/avil13/vue-act-master/commit/b3fea4f252cec0904010eea73e2c7935038926ff)
269
+ - wip saga [`c86f87f`](https://github.com/avil13/vue-act-master/commit/c86f87fbf8a62cc4278cb30fe678c88e26506e74)
270
+ - update [`52ccb9b`](https://github.com/avil13/vue-act-master/commit/52ccb9bcb414f743f21c0ce705b0d5b8f74601d7)
package/README.md ADDED
@@ -0,0 +1,112 @@
1
+ # Vue-Act-Master
2
+
3
+ ![npm bundle size](https://img.shields.io/bundlephobia/minzip/vue-act-master)
4
+ ![npm version](https://img.shields.io/npm/v/vue-act-master)
5
+
6
+ A way to separate business logic from application view.
7
+
8
+ The easiest library to create a flexible application architecture.
9
+
10
+ <div align="center">
11
+ <img src="https://raw.githubusercontent.com/avil13/vue-act-master/master/assets/act-master-logo.svg" alt="vue-act-master">
12
+ </div>
13
+
14
+ ---
15
+
16
+ ## 📗 [Documentation](https://avil13.github.io/vue-act-master/)
17
+
18
+
19
+ ## 🗺 [Example project structure](https://github.com/avil13/vue-act-master/blob/master/packages/example/README.md)
20
+
21
+ ## 🧪 [Test writing with "ActTest"](https://github.com/avil13/vue-act-master/blob/master/packages/act-master/src/test-utils/README.md)
22
+
23
+
24
+ ---
25
+
26
+ # Example
27
+
28
+ ## Installation
29
+
30
+ ```bash
31
+ npm install vue-act-master
32
+ ```
33
+
34
+ # Usage
35
+
36
+ ```ts
37
+ // main.ts
38
+ // install vue-act-master plugin
39
+ import Vue from 'vue';
40
+ import App from './App.vue';
41
+
42
+ import { VueActMaster } from 'vue-act-master';
43
+
44
+ // Actions array
45
+ import { actions } from '../you/actions/path';
46
+
47
+ Vue.use(VueActMaster, {
48
+ actions,
49
+ });
50
+
51
+ new Vue({
52
+ el: '#app',
53
+ render: (h) => h(App),
54
+ });
55
+ ```
56
+
57
+ ```ts
58
+ // ../you/actions/path
59
+ export const actions: ActMasterAction[] = [
60
+ new ClassAction(),
61
+ ]
62
+ ```
63
+
64
+ ```ts
65
+ // action-get-data.ts
66
+ import { ActMasterAction } from 'vue-act-master';
67
+
68
+ export class ClassAction implements ActMasterAction {
69
+ name = 'GetData';
70
+
71
+ async exec() {
72
+ const url = 'https://jsonplaceholder.typicode.com/todos/1';
73
+
74
+ const response = await fetch(url);
75
+ return response.json();
76
+ }
77
+ }
78
+ ```
79
+ The action is now available to you in components and you can easily highlight the business logic.
80
+
81
+ This will help you test components and change the API more easily.
82
+
83
+
84
+ ```html
85
+ // App.vue
86
+
87
+ <script>
88
+ import { SuperAPI } from '../you/api';
89
+
90
+ export default {
91
+ data() {
92
+ return {
93
+ myData: null,
94
+ };
95
+ },
96
+
97
+ async mounted() {
98
+ console.log(this.myData); // null
99
+
100
+ this.myData = await this.$act.exec('GetData');
101
+
102
+ console.log(this.myData);
103
+ // {
104
+ // "userId": 1,
105
+ // "id": 1,
106
+ // "title": "delectus aut autem",
107
+ // "completed": false
108
+ // }
109
+ }
110
+ }
111
+ </script>
112
+ ```
@@ -0,0 +1,102 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var actMaster = require('act-master');
6
+
7
+ function createDecorator(factory) {
8
+ return (target, key, index) => {
9
+ const Ctor = typeof target === 'function'
10
+ ? target
11
+ : target.constructor;
12
+ if (!Ctor.__decorators__) {
13
+ Ctor.__decorators__ = [];
14
+ }
15
+ if (typeof index !== 'number') {
16
+ index = undefined;
17
+ }
18
+ Ctor.__decorators__.push((options) => factory(options, key, index));
19
+ };
20
+ }
21
+
22
+ function ActSubscribe(eventName, pathToData, defaultValue = null) {
23
+ return createDecorator((componentOptions, key) => {
24
+ const subscribeHook = {
25
+ created() {
26
+ this.$act.subscribe(eventName, (data) => {
27
+ this[key] = (pathToData && objectPath(data, pathToData, defaultValue)) || (data !== undefined && data) || defaultValue;
28
+ }, this);
29
+ },
30
+ };
31
+ if (componentOptions.mixins) {
32
+ componentOptions.mixins = [...componentOptions.mixins, subscribeHook];
33
+ }
34
+ else {
35
+ componentOptions.mixins = [subscribeHook];
36
+ }
37
+ });
38
+ }
39
+
40
+ function ActInProgress(eventName) {
41
+ return createDecorator((componentOptions, key) => {
42
+ const inProgressHook = {
43
+ created() {
44
+ const unsubscribe = this.$act.inProgress(eventName, (inProgress) => {
45
+ this[key] = inProgress;
46
+ });
47
+ this.$once('hook:beforeDestroy', () => {
48
+ unsubscribe(eventName);
49
+ });
50
+ },
51
+ };
52
+ if (componentOptions.mixins) {
53
+ componentOptions.mixins = [...componentOptions.mixins, inProgressHook];
54
+ }
55
+ else {
56
+ componentOptions.mixins = [inProgressHook];
57
+ }
58
+ });
59
+ }
60
+
61
+ class VueActMaster {
62
+ static install(vue, options) {
63
+ var _a;
64
+ const actMaster$1 = new actMaster.ActMaster(Object.assign({ autoUnsubscribeCallback({ context, eventName, listener }) {
65
+ if (context && typeof context === 'function') {
66
+ context(function () {
67
+ actMaster$1.unsubscribe(eventName, listener);
68
+ });
69
+ }
70
+ else if (context && typeof context.$once === 'function') {
71
+ context.$once('hook:beforeDestroy', () => {
72
+ actMaster$1.unsubscribe(eventName, listener);
73
+ });
74
+ }
75
+ } }, options));
76
+ VueActMaster.instance = actMaster$1;
77
+ if (((_a = vue.config) === null || _a === void 0 ? void 0 : _a.globalProperties) && !vue.config.globalProperties.$act) {
78
+ vue.config.globalProperties.$act = actMaster$1;
79
+ vue.provide('$act', actMaster$1);
80
+ }
81
+ else if (!Object.prototype.hasOwnProperty.call(vue, '$act')) {
82
+ vue.act = actMaster$1;
83
+ vue.prototype.$act = actMaster$1;
84
+ }
85
+ }
86
+ install(vue, options) {
87
+ VueActMaster.install(vue, options);
88
+ }
89
+ }
90
+ VueActMaster.instance = null;
91
+
92
+ exports.ActInProgress = ActInProgress;
93
+ exports.ActSubscribe = ActSubscribe;
94
+ exports.VueActMaster = VueActMaster;
95
+ Object.keys(actMaster).forEach(function (k) {
96
+ if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
97
+ enumerable: true,
98
+ get: function () {
99
+ return actMaster[k];
100
+ }
101
+ });
102
+ });
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("act-master");function e(t){return(e,o,n)=>{const s="function"==typeof e?e:e.constructor;s.__decorators__||(s.__decorators__=[]),"number"!=typeof n&&(n=void 0),s.__decorators__.push((e=>t(e,o,n)))}}class o{static install(e,n){var s;const r=new t.ActMaster(Object.assign({autoUnsubscribeCallback({context:t,eventName:e,listener:o}){t&&"function"==typeof t?t((function(){r.unsubscribe(e,o)})):t&&"function"==typeof t.$once&&t.$once("hook:beforeDestroy",(()=>{r.unsubscribe(e,o)}))}},n));o.instance=r,(null===(s=e.config)||void 0===s?void 0:s.globalProperties)&&!e.config.globalProperties.$act?(e.config.globalProperties.$act=r,e.provide("$act",r)):Object.prototype.hasOwnProperty.call(e,"$act")||(e.act=r,e.prototype.$act=r)}install(t,e){o.install(t,e)}}o.instance=null,exports.ActInProgress=function(t){return e(((e,o)=>{const n={created(){const e=this.$act.inProgress(t,(t=>{this[o]=t}));this.$once("hook:beforeDestroy",(()=>{e(t)}))}};e.mixins?e.mixins=[...e.mixins,n]:e.mixins=[n]}))},exports.ActSubscribe=function(t,o,n=null){return e(((e,s)=>{const r={created(){this.$act.subscribe(t,(t=>{this[s]=o&&objectPath(t,o,n)||void 0!==t&&t||n}),this)}};e.mixins?e.mixins=[...e.mixins,r]:e.mixins=[r]}))},exports.VueActMaster=o,Object.keys(t).forEach((function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})}));
@@ -0,0 +1,89 @@
1
+ import { ActMaster } from 'act-master';
2
+ export * from 'act-master';
3
+
4
+ function createDecorator(factory) {
5
+ return (target, key, index) => {
6
+ const Ctor = typeof target === 'function'
7
+ ? target
8
+ : target.constructor;
9
+ if (!Ctor.__decorators__) {
10
+ Ctor.__decorators__ = [];
11
+ }
12
+ if (typeof index !== 'number') {
13
+ index = undefined;
14
+ }
15
+ Ctor.__decorators__.push((options) => factory(options, key, index));
16
+ };
17
+ }
18
+
19
+ function ActSubscribe(eventName, pathToData, defaultValue = null) {
20
+ return createDecorator((componentOptions, key) => {
21
+ const subscribeHook = {
22
+ created() {
23
+ this.$act.subscribe(eventName, (data) => {
24
+ this[key] = (pathToData && objectPath(data, pathToData, defaultValue)) || (data !== undefined && data) || defaultValue;
25
+ }, this);
26
+ },
27
+ };
28
+ if (componentOptions.mixins) {
29
+ componentOptions.mixins = [...componentOptions.mixins, subscribeHook];
30
+ }
31
+ else {
32
+ componentOptions.mixins = [subscribeHook];
33
+ }
34
+ });
35
+ }
36
+
37
+ function ActInProgress(eventName) {
38
+ return createDecorator((componentOptions, key) => {
39
+ const inProgressHook = {
40
+ created() {
41
+ const unsubscribe = this.$act.inProgress(eventName, (inProgress) => {
42
+ this[key] = inProgress;
43
+ });
44
+ this.$once('hook:beforeDestroy', () => {
45
+ unsubscribe(eventName);
46
+ });
47
+ },
48
+ };
49
+ if (componentOptions.mixins) {
50
+ componentOptions.mixins = [...componentOptions.mixins, inProgressHook];
51
+ }
52
+ else {
53
+ componentOptions.mixins = [inProgressHook];
54
+ }
55
+ });
56
+ }
57
+
58
+ class VueActMaster {
59
+ static install(vue, options) {
60
+ var _a;
61
+ const actMaster = new ActMaster(Object.assign({ autoUnsubscribeCallback({ context, eventName, listener }) {
62
+ if (context && typeof context === 'function') {
63
+ context(function () {
64
+ actMaster.unsubscribe(eventName, listener);
65
+ });
66
+ }
67
+ else if (context && typeof context.$once === 'function') {
68
+ context.$once('hook:beforeDestroy', () => {
69
+ actMaster.unsubscribe(eventName, listener);
70
+ });
71
+ }
72
+ } }, options));
73
+ VueActMaster.instance = actMaster;
74
+ if (((_a = vue.config) === null || _a === void 0 ? void 0 : _a.globalProperties) && !vue.config.globalProperties.$act) {
75
+ vue.config.globalProperties.$act = actMaster;
76
+ vue.provide('$act', actMaster);
77
+ }
78
+ else if (!Object.prototype.hasOwnProperty.call(vue, '$act')) {
79
+ vue.act = actMaster;
80
+ vue.prototype.$act = actMaster;
81
+ }
82
+ }
83
+ install(vue, options) {
84
+ VueActMaster.install(vue, options);
85
+ }
86
+ }
87
+ VueActMaster.instance = null;
88
+
89
+ export { ActInProgress, ActSubscribe, VueActMaster };
@@ -0,0 +1 @@
1
+ import{ActMaster as t}from"act-master";export*from"act-master";function o(t){return(o,n,e)=>{const i="function"==typeof o?o:o.constructor;i.__decorators__||(i.__decorators__=[]),"number"!=typeof e&&(e=void 0),i.__decorators__.push((o=>t(o,n,e)))}}function n(t,n,e=null){return o(((o,i)=>{const s={created(){this.$act.subscribe(t,(t=>{this[i]=n&&objectPath(t,n,e)||void 0!==t&&t||e}),this)}};o.mixins?o.mixins=[...o.mixins,s]:o.mixins=[s]}))}function e(t){return o(((o,n)=>{const e={created(){const o=this.$act.inProgress(t,(t=>{this[n]=t}));this.$once("hook:beforeDestroy",(()=>{o(t)}))}};o.mixins?o.mixins=[...o.mixins,e]:o.mixins=[e]}))}class i{static install(o,n){var e;const s=new t(Object.assign({autoUnsubscribeCallback({context:t,eventName:o,listener:n}){t&&"function"==typeof t?t((function(){s.unsubscribe(o,n)})):t&&"function"==typeof t.$once&&t.$once("hook:beforeDestroy",(()=>{s.unsubscribe(o,n)}))}},n));i.instance=s,(null===(e=o.config)||void 0===e?void 0:e.globalProperties)&&!o.config.globalProperties.$act?(o.config.globalProperties.$act=s,o.provide("$act",s)):Object.prototype.hasOwnProperty.call(o,"$act")||(o.act=s,o.prototype.$act=s)}install(t,o){i.install(t,o)}}i.instance=null;export{e as ActInProgress,n as ActSubscribe,i as VueActMaster};