vue-act-master 2.3.6 → 2.3.9

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.
@@ -1,9 +1,3 @@
1
1
  import { ActEventName } from 'act-master';
2
2
  import { VueDecorator } from './helpers';
3
- /**
4
- * Decorator auto binning on the subscription result.
5
- * Use only in Vue2 - otherwise there will be no auto unsubscribe,
6
- * that will cause memory leak.
7
- *
8
- */
9
3
  export declare function ActInProgress(eventName: ActEventName | ActEventName[]): VueDecorator;
@@ -1,11 +1,5 @@
1
1
  import { ActEventName } from 'act-master';
2
2
  import { VueDecorator } from './helpers';
3
- /**
4
- * Decorator auto binning on the subscription result.
5
- * Use only in Vue2 - otherwise there will be no auto unsubscribe,
6
- * that will cause memory leak.
7
- *
8
- */
9
3
  export declare function ActSubscribe(eventName: ActEventName, pathToData?: PathToData, defaultValue?: unknown): VueDecorator;
10
4
  type GetValueCallback = (value: any) => any;
11
5
  type PathToData = string | null | GetValueCallback;
package/dist/index.d.ts CHANGED
@@ -1,10 +1,6 @@
1
- import { ActMaster, ActMasterOptions } from 'act-master';
1
+ import { type ActMaster, type ActMasterOptions } from 'act-master';
2
2
  export * from 'act-master';
3
- export * from './decorators';
4
- /**
5
- * Declaration vue2
6
- *
7
- */
3
+ export { ActInProgress, ActSubscribe } from './decorators';
8
4
  declare module 'vue/types/vue' {
9
5
  interface Vue {
10
6
  $act: ActMaster;
@@ -13,20 +9,16 @@ declare module 'vue/types/vue' {
13
9
  act: ActMaster;
14
10
  }
15
11
  }
16
- /**
17
- * Declaration vue3
18
- *
19
- */
20
12
  declare module '@vue/runtime-core' {
21
13
  interface ComponentCustomProperties {
22
- /**
23
- * Normalized current location. See {@link RouteLocationNormalizedLoaded}.
24
- */
25
14
  $act: ActMaster;
26
15
  }
27
16
  }
28
17
  export declare class VueActMaster {
29
- static instance: ActMaster | null;
30
- static install(vue: any, options?: ActMasterOptions): void;
18
+ static actMaster: ActMaster | null;
19
+ static devtools: boolean;
20
+ static setActMaster(actMaster: ActMaster): void;
21
+ constructor(actMaster?: ActMaster);
22
+ static install(app: any, options?: ActMasterOptions): void;
31
23
  install(vue: any, options?: ActMasterOptions): void;
32
24
  }
@@ -1,10 +1,10 @@
1
1
  var D = Object.defineProperty;
2
- var C = (r, t, e) => t in r ? D(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
- var $ = (r, t, e) => (C(r, typeof t != "symbol" ? t + "" : t, e), e);
4
- var N = Object.defineProperty, x = (r, t, e) => t in r ? N(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e, c = (r, t, e) => (x(r, typeof t != "symbol" ? t + "" : t, e), e);
5
- let w = class y {
2
+ var x = (r, t, e) => t in r ? D(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var E = (r, t, e) => (x(r, typeof t != "symbol" ? t + "" : t, e), e);
4
+ var M = Object.defineProperty, N = (r, t, e) => t in r ? M(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e, o = (r, t, e) => (N(r, typeof t != "symbol" ? t + "" : t, e), e);
5
+ let v = class $ {
6
6
  constructor(t, e) {
7
- if (c(this, "reason", ""), c(this, "data"), typeof t == "string") {
7
+ if (o(this, "reason", ""), o(this, "data"), typeof t == "string") {
8
8
  this.reason = t, this.data = e;
9
9
  return;
10
10
  }
@@ -18,10 +18,10 @@ let w = class y {
18
18
  return "__CancelledAct__";
19
19
  }
20
20
  get _name() {
21
- return y._name;
21
+ return $._name;
22
22
  }
23
23
  static is(t) {
24
- return !t || typeof t != "object" ? !1 : t._name === y._name;
24
+ return !t || typeof t != "object" ? !1 : t._name === $._name;
25
25
  }
26
26
  valueOf() {
27
27
  return null;
@@ -30,12 +30,12 @@ let w = class y {
30
30
  return this.reason;
31
31
  }
32
32
  };
33
- class p extends Error {
33
+ class y extends Error {
34
34
  constructor(t) {
35
35
  super(`Can't find "${t}" action`), this.eventName = t;
36
36
  }
37
37
  }
38
- class M extends Error {
38
+ class C extends Error {
39
39
  constructor(t) {
40
40
  super(`Action "${t}" already existing`), this.eventName = t;
41
41
  }
@@ -49,61 +49,61 @@ let O = class extends Error {
49
49
  super(`"di" can't be array`);
50
50
  }
51
51
  };
52
- const k = "2.3.6", j = (r) => {
53
- r.watch && !r.$watch && (r.$watch = r.watch), r.isSingleExec && typeof r.$isSingleton != "boolean" && (r.$isSingleton = r.isSingleExec), r.validateInput && !r.$validate && (r.$validate = r.validateInput), r.errorHandlerEventName && !r.$onError && (r.$onError = r.errorHandlerEventName);
54
- }, P = class b {
52
+ const j = "2.3.9", k = (r) => {
53
+ r.watch && !r.$watch && (r.$watch = r.watch), r.isSingleExec && typeof r.$isSingleton != "boolean" && (r.$isSingleton = r.isSingleExec), typeof r.validateInput == "function" && !r.$validate && (r.$validate = r.validateInput.bind(r)), r.errorHandlerEventName && !r.$onError && (r.$onError = r.errorHandlerEventName);
54
+ }, A = class d {
55
55
  constructor(t = {}) {
56
- if (c(this, "version", k), c(this, "_actions", /* @__PURE__ */ new Map()), c(this, "_watchers", /* @__PURE__ */ new Map()), c(this, "_listeners", /* @__PURE__ */ new Map()), c(this, "_inProgressWatchers", /* @__PURE__ */ new Map()), c(this, "_subCurrentName", ""), c(this, "_subsMap", /* @__PURE__ */ new Map()), c(this, "_lastUnsubscribe", () => !1), c(this, "_DIContainer", {}), c(this, "_singlePromisesStore", /* @__PURE__ */ new Map()), c(this, "config", {
56
+ if (o(this, "version", j), o(this, "_actions", /* @__PURE__ */ new Map()), o(this, "_watchers", /* @__PURE__ */ new Map()), o(this, "_listeners", /* @__PURE__ */ new Map()), o(this, "_inProgressWatchers", /* @__PURE__ */ new Map()), o(this, "_subCurrentName", ""), o(this, "_subsMap", /* @__PURE__ */ new Map()), o(this, "_lastUnsubscribe", () => !1), o(this, "_DIContainer", {}), o(this, "_singlePromisesStore", /* @__PURE__ */ new Map()), o(this, "config", {
57
57
  errorOnReplaceDI: !1,
58
58
  autoUnsubscribeCallback: void 0,
59
59
  errorHandlerEventName: void 0
60
- }), c(this, "exec", async (n, ...f) => {
60
+ }), o(this, "exec", async (n, ...b) => {
61
61
  if (this.setProgress(n, !0), this._singlePromisesStore.has(n)) {
62
- const g = this._singlePromisesStore.get(n);
63
- if (g)
64
- return g;
62
+ const m = this._singlePromisesStore.get(n);
63
+ if (m)
64
+ return m;
65
65
  }
66
- const l = this.emit(n, ...f).catch((g) => this.catchEmitException(g, n)).finally(() => {
66
+ const l = this.emit(n, ...b).catch((m) => this.catchEmitException(m, n)).finally(() => {
67
67
  this._singlePromisesStore.has(n) && this._singlePromisesStore.delete(n), this.setProgress(n, !1);
68
68
  }), u = this.getActionOrNull(n);
69
69
  return u && u.$isSingleton && this._singlePromisesStore.set(n, l), l;
70
- }), c(this, "subscribe", (n, f, l) => {
70
+ }), o(this, "subscribe", (n, b, l) => {
71
71
  this._listeners.set(n, [
72
72
  ...this._listeners.get(n) || [],
73
- f
73
+ b
74
74
  ]);
75
- const u = () => this.unsubscribe(n, f);
75
+ const u = () => this.unsubscribe(n, b);
76
76
  return this._lastUnsubscribe = u, this.config.autoUnsubscribeCallback && this.config.autoUnsubscribeCallback({
77
77
  context: l,
78
- listener: f,
78
+ listener: b,
79
79
  eventName: n
80
80
  }), l ? typeof l == "function" ? l(u) : this.subsList.add(l, u) : this._subCurrentName && this.subsList.add(this._subCurrentName, u), u;
81
- }), c(this, "once", (n, f) => {
81
+ }), o(this, "once", (n, b) => {
82
82
  const l = this.subscribe(n, (...u) => {
83
- l(), f(...u);
83
+ l(), b(...u);
84
84
  });
85
85
  return l;
86
- }), c(this, "on", (n, f, l) => this.subscribe(n, f, l)), b.instance)
87
- return b.instance;
86
+ }), o(this, "on", (n, b, l) => this.subscribe(n, b, l)), d.instance)
87
+ return d.instance;
88
88
  const {
89
89
  actions: e,
90
90
  di: s,
91
91
  errorOnReplaceDI: i,
92
- autoUnsubscribeCallback: a,
93
- errorHandlerEventName: h
92
+ autoUnsubscribeCallback: c,
93
+ errorHandlerEventName: f
94
94
  } = t;
95
- if (e && this.addActions(e), typeof a == "function" && (this.config.autoUnsubscribeCallback = a), typeof s == "object" && s) {
95
+ if (e && this.addActions(e), typeof c == "function" && (this.config.autoUnsubscribeCallback = c), typeof s == "object" && s) {
96
96
  if (Array.isArray(s))
97
97
  throw new S();
98
98
  for (const n in s)
99
99
  Object.prototype.hasOwnProperty.call(s, n) && this.setDI(n, s[n]);
100
100
  }
101
- typeof i == "boolean" && (this.config.errorOnReplaceDI = i), typeof h == "string" && (this.config.errorHandlerEventName = h), b.instance = this;
101
+ typeof i == "boolean" && (this.config.errorOnReplaceDI = i), typeof f == "string" && (this.config.errorHandlerEventName = f), d.instance = this;
102
102
  }
103
103
  static getInstance() {
104
- if (!b.instance)
104
+ if (!d.instance)
105
105
  throw new Error("ActMaster not initialized");
106
- return b.instance;
106
+ return d.instance;
107
107
  }
108
108
  //#region [ Actions ]
109
109
  addActions(t) {
@@ -114,19 +114,19 @@ const k = "2.3.6", j = (r) => {
114
114
  addAction(t) {
115
115
  const e = t.name;
116
116
  if (this._actions.has(e))
117
- throw new M(e);
117
+ throw new C(e);
118
118
  if (t.useEmit) {
119
- const s = (i, ...a) => this.exec(i, ...a);
119
+ const s = (i, ...c) => this.exec(i, ...c);
120
120
  t.useEmit(s);
121
121
  }
122
- return j(t), this._actions.set(e, t), this.emitDIProps(t), t.$watch && t.$watch.forEach((s) => {
122
+ return k(t), this._actions.set(e, t), this.emitDIProps(t), t.$watch && t.$watch.forEach((s) => {
123
123
  const i = this._watchers.get(s) || [];
124
124
  i.push(e), this._watchers.set(s, i);
125
125
  }), this;
126
126
  }
127
127
  removeAction(t) {
128
128
  if (!this._actions.has(t))
129
- throw new p(t);
129
+ throw new y(t);
130
130
  this._actions.delete(t);
131
131
  }
132
132
  clearActions() {
@@ -139,21 +139,21 @@ const k = "2.3.6", j = (r) => {
139
139
  async emit(t, ...e) {
140
140
  const s = this.getActionOrNull(t);
141
141
  if (s === null)
142
- throw new p(t);
143
- if (s.validateInput) {
144
- const i = await s.validateInput(...e);
142
+ throw new y(t);
143
+ if (s.$validate) {
144
+ const i = await s.$validate(...e);
145
145
  if (i !== !0)
146
146
  return this.config.errorHandlerEventName && this.emit(this.config.errorHandlerEventName, i), s.$onError && this.emit(s.$onError, i), i;
147
147
  }
148
148
  try {
149
149
  const i = await s.exec(...e);
150
- return i instanceof w || w.is(i) || this.notifyListeners(t, i), i;
150
+ return i instanceof v || v.is(i) || this.notifyListeners(t, i), i;
151
151
  } catch (i) {
152
152
  return this.catchEmitException(i, t);
153
153
  }
154
154
  }
155
155
  catchEmitException(t, e) {
156
- if (t instanceof p)
156
+ if (t instanceof y)
157
157
  throw t;
158
158
  const s = this.getActionOrNull(e);
159
159
  return s != null && s.$onError && s.$onError !== e ? (this.emit(s.$onError, t), Promise.resolve(null)) : this.config.errorHandlerEventName && this.config.errorHandlerEventName !== e ? (this.emit(this.config.errorHandlerEventName, t), Promise.resolve(null)) : Promise.reject(t);
@@ -184,10 +184,10 @@ const k = "2.3.6", j = (r) => {
184
184
  */
185
185
  inProgress(t, e) {
186
186
  if (Array.isArray(t)) {
187
- t.forEach((a) => this._inProgressWatchers.set(a, e));
187
+ t.forEach((c) => this._inProgressWatchers.set(c, e));
188
188
  const i = () => {
189
- t.forEach((a) => {
190
- this._inProgressWatchers.delete(a);
189
+ t.forEach((c) => {
190
+ this._inProgressWatchers.delete(c);
191
191
  });
192
192
  };
193
193
  return this._lastUnsubscribe = i, i;
@@ -263,9 +263,9 @@ const k = "2.3.6", j = (r) => {
263
263
  }
264
264
  //#endregion
265
265
  };
266
- c(P, "instance");
267
- let _ = P;
268
- var R = Object.defineProperty, H = (r, t, e) => t in r ? R(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e, A = (r, t, e) => (H(r, typeof t != "symbol" ? t + "" : t, e), e);
266
+ o(A, "instance");
267
+ let g = A;
268
+ var R = Object.defineProperty, H = (r, t, e) => t in r ? R(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e, w = (r, t, e) => (H(r, typeof t != "symbol" ? t + "" : t, e), e);
269
269
  function K(r) {
270
270
  return function(t, e) {
271
271
  const s = t;
@@ -281,51 +281,51 @@ function q() {
281
281
  });
282
282
  };
283
283
  }
284
- const I = class o {
284
+ const I = class a {
285
285
  constructor() {
286
286
  }
287
287
  static getInstance(t = {}) {
288
- return o.resetAll(), o.removeSingleton(), o.$act = new _(t), o.$act;
288
+ return a.resetAll(), a.removeSingleton(), a.$act = new g(t), a.$act;
289
289
  }
290
290
  static setInstance(t) {
291
- o.$act = t;
291
+ a.$act = t;
292
292
  }
293
293
  static checkInstance(t) {
294
- return o.$act === t;
294
+ return a.$act === t;
295
295
  }
296
296
  static resetAll() {
297
- o.$act && (o.$act.clearActions(), o.$act.clearListeners(), o.$act.clearDI()), o._lastResult = void 0;
297
+ a.$act && (a.$act.clearActions(), a.$act.clearListeners(), a.$act.clearDI()), a._lastResult = void 0;
298
298
  }
299
299
  static removeSingleton() {
300
- _.instance = void 0, o._lastResult = void 0;
300
+ g.instance = void 0, a._lastResult = void 0;
301
301
  }
302
302
  static addActions(t) {
303
- o.$act.addActions(t);
303
+ a.$act.addActions(t);
304
304
  }
305
305
  static exec(t, ...e) {
306
- return o.$act.exec(t, ...e).then((s) => (o._lastResult = s, s)).catch((s) => {
307
- throw o._lastResult = s, s;
306
+ return a.$act.exec(t, ...e).then((s) => (a._lastResult = s, s)).catch((s) => {
307
+ throw a._lastResult = s, s;
308
308
  });
309
309
  }
310
310
  static subscribe(t, e, s) {
311
- return o.$act.subscribe(t, e, s);
311
+ return a.$act.subscribe(t, e, s);
312
312
  }
313
313
  static entityCount(t) {
314
314
  if (t === "di")
315
- return Object.keys(o.$act._DIContainer).length;
315
+ return Object.keys(a.$act._DIContainer).length;
316
316
  if (t === "actions")
317
- return o.$act._actions.size;
317
+ return a.$act._actions.size;
318
318
  const e = {
319
319
  watchers: "_watchers",
320
320
  listeners: "_listeners"
321
321
  }[t];
322
322
  let s = 0;
323
- return o.$act[e].forEach((i) => {
323
+ return a.$act[e].forEach((i) => {
324
324
  s += i.length;
325
325
  }), s;
326
326
  }
327
327
  static getLastResult() {
328
- return o._lastResult;
328
+ return a._lastResult;
329
329
  }
330
330
  static makeActionStub(t) {
331
331
  return {
@@ -335,22 +335,22 @@ const I = class o {
335
335
  };
336
336
  }
337
337
  };
338
- A(I, "$act"), A(I, "_lastResult");
338
+ w(I, "$act"), w(I, "_lastResult");
339
339
  let B = I;
340
- function d() {
341
- const r = _.getInstance();
340
+ function _() {
341
+ const r = g.getInstance();
342
342
  if (!r)
343
343
  throw new Error(
344
344
  'Instance call before initialization. Make a "new ActMaster()" first'
345
345
  );
346
346
  return r;
347
347
  }
348
- d.init = (r) => new _(r);
348
+ _.init = (r) => new g(r);
349
349
  const G = (r, t, e) => {
350
- const s = d().subscribe(r, t);
351
- return e && (typeof e == "function" ? e(s) : d().subsList.add(e, s)), s;
352
- }, L = (r) => d().subsList.clear(r);
353
- d.subListClear = L;
350
+ const s = _().subscribe(r, t);
351
+ return e && (typeof e == "function" ? e(s) : _().subsList.add(e, s)), s;
352
+ }, L = (r) => _().subsList.clear(r);
353
+ _.subListClear = L;
354
354
  const U = (r) => {
355
355
  if (typeof r != "function" || !r.name)
356
356
  throw new Error(`Pass not valid function: "${r}"`);
@@ -359,27 +359,27 @@ const U = (r) => {
359
359
  exec: r
360
360
  };
361
361
  }, J = U;
362
- function v(r) {
362
+ function P(r) {
363
363
  return (t, e, s) => {
364
364
  const i = typeof t == "function" ? t : t.constructor;
365
- i.__decorators__ || (i.__decorators__ = []), typeof s != "number" && (s = void 0), i.__decorators__.push((a) => r(a, e, s));
365
+ i.__decorators__ || (i.__decorators__ = []), typeof s != "number" && (s = void 0), i.__decorators__.push((c) => r(c, e, s));
366
366
  };
367
367
  }
368
368
  function Q(r, t, e = null) {
369
- return v((s, i) => {
370
- const a = {
369
+ return P((s, i) => {
370
+ const c = {
371
371
  created() {
372
372
  this.$act.subscribe(
373
373
  r,
374
- (h) => {
375
- const n = W(h, t, e);
374
+ (f) => {
375
+ const n = W(f, t, e);
376
376
  typeof this[i] == "function" ? this[i](n) : this[i] = n;
377
377
  },
378
378
  this
379
379
  );
380
380
  }
381
381
  };
382
- s.mixins ? s.mixins = [...s.mixins, a] : s.mixins = [a];
382
+ s.mixins ? s.mixins = [...s.mixins, c] : s.mixins = [c];
383
383
  });
384
384
  }
385
385
  function W(r, t, e) {
@@ -390,18 +390,18 @@ function W(r, t, e) {
390
390
  let s = r;
391
391
  if (t) {
392
392
  const i = (t || "").split(".");
393
- let a, h = 0;
394
- for (h = 0; h < i.length && s; h++)
395
- a = i[h], s = s[a];
393
+ let c, f = 0;
394
+ for (f = 0; f < i.length && s; f++)
395
+ c = i[f], s = s[c];
396
396
  }
397
397
  return s === void 0 ? e : s;
398
398
  }
399
399
  function X(r) {
400
- return v((t, e) => {
400
+ return P((t, e) => {
401
401
  const s = {
402
402
  created() {
403
- const i = this.$act.inProgress(r, (a) => {
404
- this[e] = a;
403
+ const i = this.$act.inProgress(r, (c) => {
404
+ this[e] = c;
405
405
  });
406
406
  this.$once("hook:beforeDestroy", () => {
407
407
  i(r);
@@ -411,41 +411,37 @@ function X(r) {
411
411
  t.mixins ? t.mixins = [...t.mixins, s] : t.mixins = [s];
412
412
  });
413
413
  }
414
- const m = class {
414
+ const h = class h {
415
+ static setActMaster(t) {
416
+ h.actMaster = t;
417
+ }
418
+ constructor(t) {
419
+ h.actMaster = t || null;
420
+ }
415
421
  static install(t, e) {
416
- var i;
417
- const s = new _({
418
- autoUnsubscribeCallback({ context: a, eventName: h, listener: n }) {
419
- a && typeof a == "function" ? a(function() {
420
- s.unsubscribe(h, n);
421
- }) : a && typeof a.$once == "function" && a.$once("hook:beforeDestroy", () => {
422
- s.unsubscribe(h, n);
423
- });
424
- },
425
- ...e
426
- });
427
- m.instance = s, (i = t.config) != null && i.globalProperties && !t.config.globalProperties.$act ? (t.config.globalProperties.$act = s, t.provide("$act", s)) : Object.prototype.hasOwnProperty.call(t, "$act") || (t.act = s, t.prototype.$act = s);
422
+ var s;
423
+ h.actMaster = h.actMaster || new g(e), (s = t.config) != null && s.globalProperties && !t.config.globalProperties.$act ? (t.config.globalProperties.$act = h.actMaster, t.provide("$act", h.actMaster)) : Object.prototype.hasOwnProperty.call(t, "$act") || (t.act = h.actMaster, t.prototype.$act = h.actMaster);
428
424
  }
429
425
  install(t, e) {
430
- m.install(t, e);
426
+ h.install(t, e);
431
427
  }
432
428
  };
433
- let E = m;
434
- $(E, "instance", null);
429
+ E(h, "actMaster", null), E(h, "devtools", !1);
430
+ let p = h;
435
431
  export {
436
432
  X as ActInProgress,
437
- _ as ActMaster,
433
+ g as ActMaster,
438
434
  Q as ActSubscribe,
439
435
  B as ActTest,
440
- M as ActinonAlreadyExistingError,
441
- w as CancelledAct,
436
+ C as ActinonAlreadyExistingError,
437
+ v as CancelledAct,
442
438
  q as Emit,
443
439
  S as InvalidDITypeError,
444
440
  O as KeyAlreadyExistsInDIError,
445
- p as NotFoundActionError,
441
+ y as NotFoundActionError,
446
442
  K as UseDI,
447
- E as VueActMaster,
448
- d as act,
443
+ p as VueActMaster,
444
+ _ as act,
449
445
  G as actSubscribe,
450
446
  J as fn2act,
451
447
  U as functionToAction
@@ -1 +1 @@
1
- (function(c,h){typeof exports=="object"&&typeof module<"u"?h(exports):typeof define=="function"&&define.amd?define(["exports"],h):(c=typeof globalThis<"u"?globalThis:c||self,h(c["vue-act-master"]={}))})(this,function(c){"use strict";var G=Object.defineProperty;var J=(c,h,_)=>h in c?G(c,h,{enumerable:!0,configurable:!0,writable:!0,value:_}):c[h]=_;var j=(c,h,_)=>(J(c,typeof h!="symbol"?h+"":h,_),_);var h=Object.defineProperty,_=(r,t,s)=>t in r?h(r,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[t]=s,l=(r,t,s)=>(_(r,typeof t!="symbol"?t+"":t,s),s);let w=class P{constructor(t,s){if(l(this,"reason",""),l(this,"data"),typeof t=="string"){this.reason=t,this.data=s;return}if(t&&typeof t=="object")return Object.assign(t,{_name:this._name,reason:t.message||""})}static get _name(){return"__CancelledAct__"}get _name(){return P._name}static is(t){return!t||typeof t!="object"?!1:t._name===P._name}valueOf(){return null}toString(){return this.reason}};class E extends Error{constructor(t){super(`Can't find "${t}" action`),this.eventName=t}}class v extends Error{constructor(t){super(`Action "${t}" already existing`),this.eventName=t}}let D=class extends Error{constructor(t){super(`"${t}" already exists in DI`),this.key=t}},C=class extends Error{constructor(){super(`"di" can't be array`)}};const k="2.3.6",R=r=>{r.watch&&!r.$watch&&(r.$watch=r.watch),r.isSingleExec&&typeof r.$isSingleton!="boolean"&&(r.$isSingleton=r.isSingleExec),r.validateInput&&!r.$validate&&(r.$validate=r.validateInput),r.errorHandlerEventName&&!r.$onError&&(r.$onError=r.errorHandlerEventName)},N=class y{constructor(t={}){if(l(this,"version",k),l(this,"_actions",new Map),l(this,"_watchers",new Map),l(this,"_listeners",new Map),l(this,"_inProgressWatchers",new Map),l(this,"_subCurrentName",""),l(this,"_subsMap",new Map),l(this,"_lastUnsubscribe",()=>!1),l(this,"_DIContainer",{}),l(this,"_singlePromisesStore",new Map),l(this,"config",{errorOnReplaceDI:!1,autoUnsubscribeCallback:void 0,errorHandlerEventName:void 0}),l(this,"exec",async(n,...d)=>{if(this.setProgress(n,!0),this._singlePromisesStore.has(n)){const p=this._singlePromisesStore.get(n);if(p)return p}const u=this.emit(n,...d).catch(p=>this.catchEmitException(p,n)).finally(()=>{this._singlePromisesStore.has(n)&&this._singlePromisesStore.delete(n),this.setProgress(n,!1)}),b=this.getActionOrNull(n);return b&&b.$isSingleton&&this._singlePromisesStore.set(n,u),u}),l(this,"subscribe",(n,d,u)=>{this._listeners.set(n,[...this._listeners.get(n)||[],d]);const b=()=>this.unsubscribe(n,d);return this._lastUnsubscribe=b,this.config.autoUnsubscribeCallback&&this.config.autoUnsubscribeCallback({context:u,listener:d,eventName:n}),u?typeof u=="function"?u(b):this.subsList.add(u,b):this._subCurrentName&&this.subsList.add(this._subCurrentName,b),b}),l(this,"once",(n,d)=>{const u=this.subscribe(n,(...b)=>{u(),d(...b)});return u}),l(this,"on",(n,d,u)=>this.subscribe(n,d,u)),y.instance)return y.instance;const{actions:s,di:e,errorOnReplaceDI:i,autoUnsubscribeCallback:a,errorHandlerEventName:f}=t;if(s&&this.addActions(s),typeof a=="function"&&(this.config.autoUnsubscribeCallback=a),typeof e=="object"&&e){if(Array.isArray(e))throw new C;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.setDI(n,e[n])}typeof i=="boolean"&&(this.config.errorOnReplaceDI=i),typeof f=="string"&&(this.config.errorHandlerEventName=f),y.instance=this}static getInstance(){if(!y.instance)throw new Error("ActMaster not initialized");return y.instance}addActions(t){Array.isArray(t)&&t.forEach(s=>{this.addAction(s)})}addAction(t){const s=t.name;if(this._actions.has(s))throw new v(s);if(t.useEmit){const e=(i,...a)=>this.exec(i,...a);t.useEmit(e)}return R(t),this._actions.set(s,t),this.emitDIProps(t),t.$watch&&t.$watch.forEach(e=>{const i=this._watchers.get(e)||[];i.push(s),this._watchers.set(e,i)}),this}removeAction(t){if(!this._actions.has(t))throw new E(t);this._actions.delete(t)}clearActions(){this._actions.clear()}clearListeners(){for(const t in this._listeners)this._listeners.has(t)&&this._listeners.delete(t)}async emit(t,...s){const e=this.getActionOrNull(t);if(e===null)throw new E(t);if(e.validateInput){const i=await e.validateInput(...s);if(i!==!0)return this.config.errorHandlerEventName&&this.emit(this.config.errorHandlerEventName,i),e.$onError&&this.emit(e.$onError,i),i}try{const i=await e.exec(...s);return i instanceof w||w.is(i)||this.notifyListeners(t,i),i}catch(i){return this.catchEmitException(i,t)}}catchEmitException(t,s){if(t instanceof E)throw t;const e=this.getActionOrNull(s);return e!=null&&e.$onError&&e.$onError!==s?(this.emit(e.$onError,t),Promise.resolve(null)):this.config.errorHandlerEventName&&this.config.errorHandlerEventName!==s?(this.emit(this.config.errorHandlerEventName,t),Promise.resolve(null)):Promise.reject(t)}notifyListeners(t,s){const e=this._listeners.get(t);if(e&&e.forEach(i=>{i(s)}),this._watchers.has(t))for(const i of this._watchers.get(t)||[])this.exec(i,s)}unsubscribe(t,s){const e=this._listeners.get(t);if(!e)return this._subsMap.set(t,[]),!1;const i=e.indexOf(s);return i>-1&&e.splice(i,1),this._listeners.set(t,e),i>-1}off(t,s){return this.unsubscribe(t,s)}inProgress(t,s){if(Array.isArray(t)){t.forEach(a=>this._inProgressWatchers.set(a,s));const i=()=>{t.forEach(a=>{this._inProgressWatchers.delete(a)})};return this._lastUnsubscribe=i,i}this._inProgressWatchers.set(t,s);const e=()=>this._inProgressWatchers.delete(t);return this._lastUnsubscribe=e,e}setProgress(t,s){this._inProgressWatchers.has(t)&&this._inProgressWatchers.get(t)(s)}get subsList(){const t=s=>{(this._subsMap.get(s)||[]).forEach(e=>e()),this._subsMap.delete(s)};return{add:(s,...e)=>{this._subCurrentName=s;const i=this._subsMap.get(s)||[];return e.length&&i.push(...e),this._subsMap.set(s,i),t},clear:t}}clearDI(){this._DIContainer={}}setDI(t,s){if(this.config.errorOnReplaceDI&&this._DIContainer[t])throw new D(t);return this._DIContainer[t]=s,this.freshEmitDI(),this}getDI(t){return this._DIContainer[t]}freshEmitDI(){let t;Object.keys(this._actions).forEach(s=>{t=this._actions.get(s),t&&this.emitDIProps(t)})}emitDIProps(t){t._DI_CONTAINER_||Object.defineProperty(t,"_DI_CONTAINER_",{get:()=>this._DIContainer,enumerable:!1}),t._DI_MAP_&&Object.keys(t._DI_MAP_).forEach(s=>{var e;if(t[s])return;const i=(e=t._DI_MAP_)==null?void 0:e[s];i&&Object.defineProperty(t,s,{get(){return this._DI_CONTAINER_[i]},enumerable:!0})}),t.useDI&&t.useDI(this._DIContainer)}getActionOrNull(t){return this._actions.get(t)||null}};l(N,"instance");let g=N;var H=Object.defineProperty,x=(r,t,s)=>t in r?H(r,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[t]=s,M=(r,t,s)=>(x(r,typeof t!="symbol"?t+"":t,s),s);function L(r){return function(t,s){const e=t;e._DI_MAP_||(e._DI_MAP_={}),e._DI_MAP_[s]=r}}function U(){return(r,t)=>{Object.defineProperty(r,"useEmit",{value:function(s){this[t]=s}})}}const A=class o{constructor(){}static getInstance(t={}){return o.resetAll(),o.removeSingleton(),o.$act=new g(t),o.$act}static setInstance(t){o.$act=t}static checkInstance(t){return o.$act===t}static resetAll(){o.$act&&(o.$act.clearActions(),o.$act.clearListeners(),o.$act.clearDI()),o._lastResult=void 0}static removeSingleton(){g.instance=void 0,o._lastResult=void 0}static addActions(t){o.$act.addActions(t)}static exec(t,...s){return o.$act.exec(t,...s).then(e=>(o._lastResult=e,e)).catch(e=>{throw o._lastResult=e,e})}static subscribe(t,s,e){return o.$act.subscribe(t,s,e)}static entityCount(t){if(t==="di")return Object.keys(o.$act._DIContainer).length;if(t==="actions")return o.$act._actions.size;const s={watchers:"_watchers",listeners:"_listeners"}[t];let e=0;return o.$act[s].forEach(i=>{e+=i.length}),e}static getLastResult(){return o._lastResult}static makeActionStub(t){return{name:`Act_${Math.random()}`,exec:()=>null,...t}}};M(A,"$act"),M(A,"_lastResult");let T=A;function m(){const r=g.getInstance();if(!r)throw new Error('Instance call before initialization. Make a "new ActMaster()" first');return r}m.init=r=>new g(r);const W=(r,t,s)=>{const e=m().subscribe(r,t);return s&&(typeof s=="function"?s(e):m().subsList.add(s,e)),e},z=r=>m().subsList.clear(r);m.subListClear=z;const O=r=>{if(typeof r!="function"||!r.name)throw new Error(`Pass not valid function: "${r}"`);return{name:r.name,exec:r}},F=O;function S(r){return(t,s,e)=>{const i=typeof t=="function"?t:t.constructor;i.__decorators__||(i.__decorators__=[]),typeof e!="number"&&(e=void 0),i.__decorators__.push(a=>r(a,s,e))}}function K(r,t,s=null){return S((e,i)=>{const a={created(){this.$act.subscribe(r,f=>{const n=q(f,t,s);typeof this[i]=="function"?this[i](n):this[i]=n},this)}};e.mixins?e.mixins=[...e.mixins,a]:e.mixins=[a]})}function q(r,t,s){if(r===void 0)return s;if(typeof t=="function")return t(r);let e=r;if(t){const i=(t||"").split(".");let a,f=0;for(f=0;f<i.length&&e;f++)a=i[f],e=e[a]}return e===void 0?s:e}function B(r){return S((t,s)=>{const e={created(){const i=this.$act.inProgress(r,a=>{this[s]=a});this.$once("hook:beforeDestroy",()=>{i(r)})}};t.mixins?t.mixins=[...t.mixins,e]:t.mixins=[e]})}const $=class{static install(t,s){var i;const e=new g({autoUnsubscribeCallback({context:a,eventName:f,listener:n}){a&&typeof a=="function"?a(function(){e.unsubscribe(f,n)}):a&&typeof a.$once=="function"&&a.$once("hook:beforeDestroy",()=>{e.unsubscribe(f,n)})},...s});$.instance=e,(i=t.config)!=null&&i.globalProperties&&!t.config.globalProperties.$act?(t.config.globalProperties.$act=e,t.provide("$act",e)):Object.prototype.hasOwnProperty.call(t,"$act")||(t.act=e,t.prototype.$act=e)}install(t,s){$.install(t,s)}};let I=$;j(I,"instance",null),c.ActInProgress=B,c.ActMaster=g,c.ActSubscribe=K,c.ActTest=T,c.ActinonAlreadyExistingError=v,c.CancelledAct=w,c.Emit=U,c.InvalidDITypeError=C,c.KeyAlreadyExistsInDIError=D,c.NotFoundActionError=E,c.UseDI=L,c.VueActMaster=I,c.act=m,c.actSubscribe=W,c.fn2act=F,c.functionToAction=O,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
1
+ (function(n,h){typeof exports=="object"&&typeof module<"u"?h(exports):typeof define=="function"&&define.amd?define(["exports"],h):(n=typeof globalThis<"u"?globalThis:n||self,h(n["vue-act-master"]={}))})(this,function(n){"use strict";var G=Object.defineProperty;var J=(n,h,_)=>h in n?G(n,h,{enumerable:!0,configurable:!0,writable:!0,value:_}):n[h]=_;var P=(n,h,_)=>(J(n,typeof h!="symbol"?h+"":h,_),_);var h=Object.defineProperty,_=(r,t,e)=>t in r?h(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,o=(r,t,e)=>(_(r,typeof t!="symbol"?t+"":t,e),e);let v=class D{constructor(t,e){if(o(this,"reason",""),o(this,"data"),typeof t=="string"){this.reason=t,this.data=e;return}if(t&&typeof t=="object")return Object.assign(t,{_name:this._name,reason:t.message||""})}static get _name(){return"__CancelledAct__"}get _name(){return D._name}static is(t){return!t||typeof t!="object"?!1:t._name===D._name}valueOf(){return null}toString(){return this.reason}};class I extends Error{constructor(t){super(`Can't find "${t}" action`),this.eventName=t}}class p extends Error{constructor(t){super(`Action "${t}" already existing`),this.eventName=t}}let M=class extends Error{constructor(t){super(`"${t}" already exists in DI`),this.key=t}},N=class extends Error{constructor(){super(`"di" can't be array`)}};const x="2.3.9",k=r=>{r.watch&&!r.$watch&&(r.$watch=r.watch),r.isSingleExec&&typeof r.$isSingleton!="boolean"&&(r.$isSingleton=r.isSingleExec),typeof r.validateInput=="function"&&!r.$validate&&(r.$validate=r.validateInput.bind(r)),r.errorHandlerEventName&&!r.$onError&&(r.$onError=r.errorHandlerEventName)},C=class E{constructor(t={}){if(o(this,"version",x),o(this,"_actions",new Map),o(this,"_watchers",new Map),o(this,"_listeners",new Map),o(this,"_inProgressWatchers",new Map),o(this,"_subCurrentName",""),o(this,"_subsMap",new Map),o(this,"_lastUnsubscribe",()=>!1),o(this,"_DIContainer",{}),o(this,"_singlePromisesStore",new Map),o(this,"config",{errorOnReplaceDI:!1,autoUnsubscribeCallback:void 0,errorHandlerEventName:void 0}),o(this,"exec",async(c,...g)=>{if(this.setProgress(c,!0),this._singlePromisesStore.has(c)){const $=this._singlePromisesStore.get(c);if($)return $}const f=this.emit(c,...g).catch($=>this.catchEmitException($,c)).finally(()=>{this._singlePromisesStore.has(c)&&this._singlePromisesStore.delete(c),this.setProgress(c,!1)}),b=this.getActionOrNull(c);return b&&b.$isSingleton&&this._singlePromisesStore.set(c,f),f}),o(this,"subscribe",(c,g,f)=>{this._listeners.set(c,[...this._listeners.get(c)||[],g]);const b=()=>this.unsubscribe(c,g);return this._lastUnsubscribe=b,this.config.autoUnsubscribeCallback&&this.config.autoUnsubscribeCallback({context:f,listener:g,eventName:c}),f?typeof f=="function"?f(b):this.subsList.add(f,b):this._subCurrentName&&this.subsList.add(this._subCurrentName,b),b}),o(this,"once",(c,g)=>{const f=this.subscribe(c,(...b)=>{f(),g(...b)});return f}),o(this,"on",(c,g,f)=>this.subscribe(c,g,f)),E.instance)return E.instance;const{actions:e,di:s,errorOnReplaceDI:i,autoUnsubscribeCallback:l,errorHandlerEventName:d}=t;if(e&&this.addActions(e),typeof l=="function"&&(this.config.autoUnsubscribeCallback=l),typeof s=="object"&&s){if(Array.isArray(s))throw new N;for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&this.setDI(c,s[c])}typeof i=="boolean"&&(this.config.errorOnReplaceDI=i),typeof d=="string"&&(this.config.errorHandlerEventName=d),E.instance=this}static getInstance(){if(!E.instance)throw new Error("ActMaster not initialized");return E.instance}addActions(t){Array.isArray(t)&&t.forEach(e=>{this.addAction(e)})}addAction(t){const e=t.name;if(this._actions.has(e))throw new p(e);if(t.useEmit){const s=(i,...l)=>this.exec(i,...l);t.useEmit(s)}return k(t),this._actions.set(e,t),this.emitDIProps(t),t.$watch&&t.$watch.forEach(s=>{const i=this._watchers.get(s)||[];i.push(e),this._watchers.set(s,i)}),this}removeAction(t){if(!this._actions.has(t))throw new I(t);this._actions.delete(t)}clearActions(){this._actions.clear()}clearListeners(){for(const t in this._listeners)this._listeners.has(t)&&this._listeners.delete(t)}async emit(t,...e){const s=this.getActionOrNull(t);if(s===null)throw new I(t);if(s.$validate){const i=await s.$validate(...e);if(i!==!0)return this.config.errorHandlerEventName&&this.emit(this.config.errorHandlerEventName,i),s.$onError&&this.emit(s.$onError,i),i}try{const i=await s.exec(...e);return i instanceof v||v.is(i)||this.notifyListeners(t,i),i}catch(i){return this.catchEmitException(i,t)}}catchEmitException(t,e){if(t instanceof I)throw t;const s=this.getActionOrNull(e);return s!=null&&s.$onError&&s.$onError!==e?(this.emit(s.$onError,t),Promise.resolve(null)):this.config.errorHandlerEventName&&this.config.errorHandlerEventName!==e?(this.emit(this.config.errorHandlerEventName,t),Promise.resolve(null)):Promise.reject(t)}notifyListeners(t,e){const s=this._listeners.get(t);if(s&&s.forEach(i=>{i(e)}),this._watchers.has(t))for(const i of this._watchers.get(t)||[])this.exec(i,e)}unsubscribe(t,e){const s=this._listeners.get(t);if(!s)return this._subsMap.set(t,[]),!1;const i=s.indexOf(e);return i>-1&&s.splice(i,1),this._listeners.set(t,s),i>-1}off(t,e){return this.unsubscribe(t,e)}inProgress(t,e){if(Array.isArray(t)){t.forEach(l=>this._inProgressWatchers.set(l,e));const i=()=>{t.forEach(l=>{this._inProgressWatchers.delete(l)})};return this._lastUnsubscribe=i,i}this._inProgressWatchers.set(t,e);const s=()=>this._inProgressWatchers.delete(t);return this._lastUnsubscribe=s,s}setProgress(t,e){this._inProgressWatchers.has(t)&&this._inProgressWatchers.get(t)(e)}get subsList(){const t=e=>{(this._subsMap.get(e)||[]).forEach(s=>s()),this._subsMap.delete(e)};return{add:(e,...s)=>{this._subCurrentName=e;const i=this._subsMap.get(e)||[];return s.length&&i.push(...s),this._subsMap.set(e,i),t},clear:t}}clearDI(){this._DIContainer={}}setDI(t,e){if(this.config.errorOnReplaceDI&&this._DIContainer[t])throw new M(t);return this._DIContainer[t]=e,this.freshEmitDI(),this}getDI(t){return this._DIContainer[t]}freshEmitDI(){let t;Object.keys(this._actions).forEach(e=>{t=this._actions.get(e),t&&this.emitDIProps(t)})}emitDIProps(t){t._DI_CONTAINER_||Object.defineProperty(t,"_DI_CONTAINER_",{get:()=>this._DIContainer,enumerable:!1}),t._DI_MAP_&&Object.keys(t._DI_MAP_).forEach(e=>{var s;if(t[e])return;const i=(s=t._DI_MAP_)==null?void 0:s[e];i&&Object.defineProperty(t,e,{get(){return this._DI_CONTAINER_[i]},enumerable:!0})}),t.useDI&&t.useDI(this._DIContainer)}getActionOrNull(t){return this._actions.get(t)||null}};o(C,"instance");let m=C;var R=Object.defineProperty,H=(r,t,e)=>t in r?R(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,O=(r,t,e)=>(H(r,typeof t!="symbol"?t+"":t,e),e);function L(r){return function(t,e){const s=t;s._DI_MAP_||(s._DI_MAP_={}),s._DI_MAP_[e]=r}}function U(){return(r,t)=>{Object.defineProperty(r,"useEmit",{value:function(e){this[t]=e}})}}const w=class a{constructor(){}static getInstance(t={}){return a.resetAll(),a.removeSingleton(),a.$act=new m(t),a.$act}static setInstance(t){a.$act=t}static checkInstance(t){return a.$act===t}static resetAll(){a.$act&&(a.$act.clearActions(),a.$act.clearListeners(),a.$act.clearDI()),a._lastResult=void 0}static removeSingleton(){m.instance=void 0,a._lastResult=void 0}static addActions(t){a.$act.addActions(t)}static exec(t,...e){return a.$act.exec(t,...e).then(s=>(a._lastResult=s,s)).catch(s=>{throw a._lastResult=s,s})}static subscribe(t,e,s){return a.$act.subscribe(t,e,s)}static entityCount(t){if(t==="di")return Object.keys(a.$act._DIContainer).length;if(t==="actions")return a.$act._actions.size;const e={watchers:"_watchers",listeners:"_listeners"}[t];let s=0;return a.$act[e].forEach(i=>{s+=i.length}),s}static getLastResult(){return a._lastResult}static makeActionStub(t){return{name:`Act_${Math.random()}`,exec:()=>null,...t}}};O(w,"$act"),O(w,"_lastResult");let T=w;function y(){const r=m.getInstance();if(!r)throw new Error('Instance call before initialization. Make a "new ActMaster()" first');return r}y.init=r=>new m(r);const W=(r,t,e)=>{const s=y().subscribe(r,t);return e&&(typeof e=="function"?e(s):y().subsList.add(e,s)),s},z=r=>y().subsList.clear(r);y.subListClear=z;const S=r=>{if(typeof r!="function"||!r.name)throw new Error(`Pass not valid function: "${r}"`);return{name:r.name,exec:r}},F=S;function j(r){return(t,e,s)=>{const i=typeof t=="function"?t:t.constructor;i.__decorators__||(i.__decorators__=[]),typeof s!="number"&&(s=void 0),i.__decorators__.push(l=>r(l,e,s))}}function K(r,t,e=null){return j((s,i)=>{const l={created(){this.$act.subscribe(r,d=>{const c=q(d,t,e);typeof this[i]=="function"?this[i](c):this[i]=c},this)}};s.mixins?s.mixins=[...s.mixins,l]:s.mixins=[l]})}function q(r,t,e){if(r===void 0)return e;if(typeof t=="function")return t(r);let s=r;if(t){const i=(t||"").split(".");let l,d=0;for(d=0;d<i.length&&s;d++)l=i[d],s=s[l]}return s===void 0?e:s}function B(r){return j((t,e)=>{const s={created(){const i=this.$act.inProgress(r,l=>{this[e]=l});this.$once("hook:beforeDestroy",()=>{i(r)})}};t.mixins?t.mixins=[...t.mixins,s]:t.mixins=[s]})}const u=class u{static setActMaster(t){u.actMaster=t}constructor(t){u.actMaster=t||null}static install(t,e){var s;u.actMaster=u.actMaster||new m(e),(s=t.config)!=null&&s.globalProperties&&!t.config.globalProperties.$act?(t.config.globalProperties.$act=u.actMaster,t.provide("$act",u.actMaster)):Object.prototype.hasOwnProperty.call(t,"$act")||(t.act=u.actMaster,t.prototype.$act=u.actMaster)}install(t,e){u.install(t,e)}};P(u,"actMaster",null),P(u,"devtools",!1);let A=u;n.ActInProgress=B,n.ActMaster=m,n.ActSubscribe=K,n.ActTest=T,n.ActinonAlreadyExistingError=p,n.CancelledAct=v,n.Emit=U,n.InvalidDITypeError=N,n.KeyAlreadyExistsInDIError=M,n.NotFoundActionError=I,n.UseDI=L,n.VueActMaster=A,n.act=y,n.actSubscribe=W,n.fn2act=F,n.functionToAction=S,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-act-master",
3
- "version": "2.3.6",
3
+ "version": "2.3.9",
4
4
  "description": "",
5
5
  "author": "avil13",
6
6
  "main": "dist/vue-act-master.umd.cjs",
@@ -38,7 +38,7 @@
38
38
  "test:coverage": "vitest run --coverage",
39
39
  "type-check:watch": "npm run type-check -- --watch",
40
40
  "type-check": "tsc -p ./tsconfig.json --noEmit",
41
- "prepublishOnly": "yarn test && yarn run build"
41
+ "prepublishOnly": "npm test && npm run build"
42
42
  },
43
43
  "husky": {
44
44
  "hooks": {
@@ -52,17 +52,16 @@
52
52
  },
53
53
  "license": "MIT",
54
54
  "dependencies": {
55
- "act-master": "^2.3.6"
55
+ "act-master": "^2.3.8"
56
56
  },
57
57
  "peerDependencies": {
58
- "act-master": "^2.3.6"
58
+ "act-master": "*"
59
59
  },
60
60
  "devDependencies": {
61
- "@babel/types": "^7.22.5",
62
- "auto-changelog": "^2.4.0",
63
- "typescript": "^5.0.4",
64
- "vite": "^4.3.7",
65
- "vitest": "^0.31.0",
61
+ "@babel/types": "^7.23.5",
62
+ "typescript": "^5.3.3",
63
+ "vite": "^5.1.4",
64
+ "vitest": "^1.3.1",
66
65
  "vue": "*"
67
66
  }
68
67
  }
@@ -111,7 +111,7 @@ describe('VueActMaster', () => {
111
111
  expect(result).not.toBe(subscribedData);
112
112
  });
113
113
 
114
- it('unsubscribe auto', async () => {
114
+ it.skip('unsubscribe auto', async () => {
115
115
  ACTION_NAME = 'ACTION_NAME_UN_AUTO';
116
116
 
117
117
  addTestAction(ACTION_NAME);
package/src/index.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { ActMaster, ActMasterOptions } from 'act-master';
1
+ import { type ActMaster, type ActMasterOptions } from 'act-master';
2
+ import { ActMaster as AM } from 'act-master';
2
3
 
3
4
  export * from 'act-master';
4
- export * from './decorators';
5
+ export { ActInProgress, ActSubscribe } from './decorators';
5
6
 
6
7
  /**
7
8
  * Declaration vue2
@@ -33,38 +34,36 @@ declare module '@vue/runtime-core' {
33
34
  }
34
35
 
35
36
  export class VueActMaster {
36
- static instance: ActMaster | null = null;
37
+ static actMaster: ActMaster | null = null;
37
38
 
38
- static install(vue: any, options?: ActMasterOptions): void {
39
- const actMaster = new ActMaster({
40
- autoUnsubscribeCallback({ context, eventName, listener }) {
41
- if (context && typeof context === 'function') {
42
- // vue 3
43
- context(function () {
44
- actMaster.unsubscribe(eventName, listener);
45
- });
46
- } else if (context && typeof context.$once === 'function') {
47
- // vue 2
48
- context.$once('hook:beforeDestroy', () => {
49
- actMaster.unsubscribe(eventName, listener);
50
- });
51
- }
52
- },
53
- ...options,
54
- });
39
+ static devtools = false;
55
40
 
56
- VueActMaster.instance = actMaster;
41
+ static setActMaster(actMaster: ActMaster) {
42
+ VueActMaster.actMaster = actMaster;
43
+ }
44
+
45
+ constructor(actMaster?: ActMaster) {
46
+ VueActMaster.actMaster = actMaster || null;
47
+ }
48
+
49
+ static install(app: any, options?: ActMasterOptions): void {
50
+ VueActMaster.actMaster = VueActMaster.actMaster || new AM(options);
57
51
 
58
52
  // add the instance method
59
- if (vue.config?.globalProperties && !vue.config.globalProperties.$act) {
53
+ if (app.config?.globalProperties && !app.config.globalProperties.$act) {
60
54
  // vue 3
61
- vue.config.globalProperties.$act = actMaster;
62
- vue.provide('$act', actMaster);
63
- } else if (!Object.prototype.hasOwnProperty.call(vue, '$act')) {
55
+ app.config.globalProperties.$act = VueActMaster.actMaster;
56
+ app.provide('$act', VueActMaster.actMaster);
57
+ } else if (!Object.prototype.hasOwnProperty.call(app, '$act')) {
64
58
  // vue 2
65
- vue.act = actMaster;
66
- vue.prototype.$act = actMaster;
59
+ app.act = VueActMaster.actMaster;
60
+ app.prototype.$act = VueActMaster.actMaster;
67
61
  }
62
+
63
+ // // devtool
64
+ // if (VueActMaster.devtools) {
65
+ // addDevtools(app, VueActMaster.actMaster);
66
+ // }
68
67
  }
69
68
 
70
69
  install(vue: any, options?: ActMasterOptions): void {
package/CHANGELOG.md DELETED
@@ -1,429 +0,0 @@
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.11.5](https://github.com/avil13/vue-act-master/compare/v1.11.1...v1.11.5)
8
-
9
- > 20 May 2022
10
-
11
- - feat(act-master-cli): updated tests & added interfacePrefix [`c5a8367`](https://github.com/avil13/vue-act-master/commit/c5a8367fcbdd4617adbda146d953ebf73cb5f8ab)
12
- - feat(act-master-cli): added cli utility for creating action interface [`5391f50`](https://github.com/avil13/vue-act-master/commit/5391f50cd56cb0cb7fe91244ea68f67bf186046d)
13
- - wip [`1c3fd24`](https://github.com/avil13/vue-act-master/commit/1c3fd24b4b558dd0df9c422cd25d5be6b78258eb)
14
-
15
- #### [v1.11.1](https://github.com/avil13/vue-act-master/compare/v1.11.0...v1.11.1)
16
-
17
- > 29 March 2022
18
-
19
- - chore: changelog [`1157982`](https://github.com/avil13/vue-act-master/commit/115798267eecde7a3f241257e0814f75ad57fa2a)
20
- - fix: fixed ActName global event type [`9378779`](https://github.com/avil13/vue-act-master/commit/93787793c3134fa4472f4a6e620425cda8c65778)
21
-
22
- #### [v1.11.0](https://github.com/avil13/vue-act-master/compare/v1.10.8...v1.11.0)
23
-
24
- > 22 March 2022
25
-
26
- - feat: change act help function types [`e234b71`](https://github.com/avil13/vue-act-master/commit/e234b71da77a542f700ef3aa9fcb872354ec887a)
27
-
28
- #### [v1.10.8](https://github.com/avil13/vue-act-master/compare/v1.10.7...v1.10.8)
29
-
30
- > 10 March 2022
31
-
32
- - feat: CancelledAct wrapp error in ActMaster.exec [`ff0bc4d`](https://github.com/avil13/vue-act-master/commit/ff0bc4de2783018e5a11e91684f777c1b68399e2)
33
-
34
- #### [v1.10.7](https://github.com/avil13/vue-act-master/compare/v1.10.5...v1.10.7)
35
-
36
- > 10 March 2022
37
-
38
- - feat: changes the type of the returned object from the exec method [`c1437b4`](https://github.com/avil13/vue-act-master/commit/c1437b4cf73f9d2a212fb64f9abf424a15e3a91c)
39
- - feat: add extend object with CancelledAct [`c8911d8`](https://github.com/avil13/vue-act-master/commit/c8911d8f2eae298e7e47e81e731330b88b1ac936)
40
-
41
- #### [v1.10.5](https://github.com/avil13/vue-act-master/compare/v1.10.4...v1.10.5)
42
-
43
- > 3 March 2022
44
-
45
- - build(deps): bump prismjs from 1.25.0 to 1.27.0 [`#28`](https://github.com/avil13/vue-act-master/pull/28)
46
- - build(deps): bump nanoid from 3.1.30 to 3.2.0 [`#27`](https://github.com/avil13/vue-act-master/pull/27)
47
- - chore: remove Jest add Vitest [`d777b9c`](https://github.com/avil13/vue-act-master/commit/d777b9c0772b2a6050a3f684b9f560383536931e)
48
- - chore: remove unused deps [`2da37d6`](https://github.com/avil13/vue-act-master/commit/2da37d6804f30b34ab7c7fd4ab4e926a848f4b18)
49
- - chore: remove commitizen [`540df34`](https://github.com/avil13/vue-act-master/commit/540df3477c2a3880a3fc26ea9ba28f63d943aa4a)
50
-
51
- #### [v1.10.4](https://github.com/avil13/vue-act-master/compare/v1.10.3...v1.10.4)
52
-
53
- > 12 December 2021
54
-
55
- - fix(act-master): fixed wait removerd types [`be2e48e`](https://github.com/avil13/vue-act-master/commit/be2e48e0259ef2f332fa11b70eac8adec75dd43a)
56
-
57
- #### [v1.10.3](https://github.com/avil13/vue-act-master/compare/v1.10.2...v1.10.3)
58
-
59
- > 10 December 2021
60
-
61
- - fix(act-master): act.subscribe - fixed unsubscribe param [`e571892`](https://github.com/avil13/vue-act-master/commit/e5718925fd0efdc9e4dec4241d7ec4aa89fc14e2)
62
-
63
- #### [v1.10.2](https://github.com/avil13/vue-act-master/compare/v1.10.1...v1.10.2)
64
-
65
- > 10 December 2021
66
-
67
- - changelog(vue-act-master) [`efb304d`](https://github.com/avil13/vue-act-master/commit/efb304d3c095eec416bdfd0ee6bf4d43d355fede)
68
- - doc(vue-act-master): fix readme [`1a79d1c`](https://github.com/avil13/vue-act-master/commit/1a79d1c55bb4714df4d436d7664790228001f5a9)
69
- - fix(act-master): act.subscribe - fixed unsubscribe param [`e925305`](https://github.com/avil13/vue-act-master/commit/e9253059e241e824513d403cdeeb2c18adf763ac)
70
-
71
- #### [v1.10.1](https://github.com/avil13/vue-act-master/compare/v1.10.0...v1.10.1)
72
-
73
- > 6 December 2021
74
-
75
- - changelog(vue-act-master) [`551e096`](https://github.com/avil13/vue-act-master/commit/551e096a9c31648c30f0d6fcf314b9be5d0551ed)
76
- - fix(vue-act-master): fix ActSubscribe - get default value [`1aa62a7`](https://github.com/avil13/vue-act-master/commit/1aa62a7781cc46fed6005afaaf94d3a09387c2c8)
77
- - changelog [`8ac56d1`](https://github.com/avil13/vue-act-master/commit/8ac56d1f1e79a0bb8a17e5f45450c0a90b3b9c7b)
78
-
79
- #### [v1.10.0](https://github.com/avil13/vue-act-master/compare/v1.9.0...v1.10.0)
80
-
81
- > 30 November 2021
82
-
83
- - chore: upgrade deps [`e0b2f9b`](https://github.com/avil13/vue-act-master/commit/e0b2f9bdd300539fdd6023652a67429155ce9e04)
84
- - feat: added size-limit library [`9dbc21b`](https://github.com/avil13/vue-act-master/commit/9dbc21ba36a917eb486a3de93bb1e82144ae8d4f)
85
- - docs: added composition api examples [`6b5756f`](https://github.com/avil13/vue-act-master/commit/6b5756fe52311c1c5730eff1203abbd3d372db02)
86
-
87
- #### [v1.9.0](https://github.com/avil13/vue-act-master/compare/v1.3.4...v1.9.0)
88
-
89
- > 22 October 2021
90
-
91
- - Feat/progress [`#26`](https://github.com/avil13/vue-act-master/pull/26)
92
- - build(deps): bump tmpl from 1.0.4 to 1.0.5 [`#25`](https://github.com/avil13/vue-act-master/pull/25)
93
- - build(deps): bump ws from 7.4.5 to 7.5.0 [`#17`](https://github.com/avil13/vue-act-master/pull/17)
94
- - build(deps): bump postcss from 7.0.35 to 7.0.36 [`#18`](https://github.com/avil13/vue-act-master/pull/18)
95
- - build(deps): bump ssri from 8.0.0 to 8.0.1 [`#14`](https://github.com/avil13/vue-act-master/pull/14)
96
- - chore: removed unused packages [`04f38de`](https://github.com/avil13/vue-act-master/commit/04f38de4e233faab7027602439ded4cf759fa2c1)
97
- - docs: up vitepress [`29a78fa`](https://github.com/avil13/vue-act-master/commit/29a78fa474c9be104aceaf13d7bf7bde43661b9f)
98
- - chore: update deps [`277124b`](https://github.com/avil13/vue-act-master/commit/277124b67ce992809890781f9e372de30bbfbdfd)
99
-
100
- #### [v1.3.4](https://github.com/avil13/vue-act-master/compare/v1.3.3...v1.3.4)
101
-
102
- > 9 January 2021
103
-
104
- - fix: readme [`abfbc54`](https://github.com/avil13/vue-act-master/commit/abfbc5464654a4619533d22cc46d59437a14fc0d)
105
- - fix: readme and changelog script [`4067816`](https://github.com/avil13/vue-act-master/commit/4067816b7fc899fc64b834bcc95d7ee84afb7849)
106
-
107
- #### [v1.3.3](https://github.com/avil13/vue-act-master/compare/v1.0.3...v1.3.3)
108
-
109
- > 9 January 2021
110
-
111
- - build(deps): bump node-notifier from 8.0.0 to 8.0.1 [`#13`](https://github.com/avil13/vue-act-master/pull/13)
112
- - build(deps): bump ini from 1.3.5 to 1.3.8 [`#10`](https://github.com/avil13/vue-act-master/pull/10)
113
- - Create LICENSE [`#8`](https://github.com/avil13/vue-act-master/pull/8)
114
- - 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)
115
- - feat(act-master): CancelledAct method "is" [`fcd75ab`](https://github.com/avil13/vue-act-master/commit/fcd75abe135a4c61881f0b11766a56f45d1a9678)
116
- - feat(vue-act-master): updated act-master to v1.1.0 [`eb58a61`](https://github.com/avil13/vue-act-master/commit/eb58a61261f0341b2a50b05bca81b4469344b3c1)
117
- - feat(docs): vitepress documentation [`14998c2`](https://github.com/avil13/vue-act-master/commit/14998c2981bcf1572f81350f26c4b2f8153d1491)
118
-
119
- ### [v1.0.3](https://github.com/avil13/vue-act-master/compare/v0.16.0...v1.0.3)
120
-
121
- > 20 October 2020
122
-
123
- #### [v0.16.0](https://github.com/avil13/vue-act-master/compare/v0.15.3...v0.16.0)
124
-
125
- > 22 March 2022
126
-
127
- - feat: change act help function types [`e234b71`](https://github.com/avil13/vue-act-master/commit/e234b71da77a542f700ef3aa9fcb872354ec887a)
128
- - feat: changes the type of the returned object from the exec method [`c1437b4`](https://github.com/avil13/vue-act-master/commit/c1437b4cf73f9d2a212fb64f9abf424a15e3a91c)
129
- - feat: add extend object with CancelledAct [`c8911d8`](https://github.com/avil13/vue-act-master/commit/c8911d8f2eae298e7e47e81e731330b88b1ac936)
130
-
131
- #### [v0.15.3](https://github.com/avil13/vue-act-master/compare/v0.15.2...v0.15.3)
132
-
133
- > 3 March 2022
134
-
135
- - build(deps): bump prismjs from 1.25.0 to 1.27.0 [`#28`](https://github.com/avil13/vue-act-master/pull/28)
136
- - build(deps): bump nanoid from 3.1.30 to 3.2.0 [`#27`](https://github.com/avil13/vue-act-master/pull/27)
137
- - chore: remove Jest add Vitest [`d777b9c`](https://github.com/avil13/vue-act-master/commit/d777b9c0772b2a6050a3f684b9f560383536931e)
138
- - chore: remove unused deps [`2da37d6`](https://github.com/avil13/vue-act-master/commit/2da37d6804f30b34ab7c7fd4ab4e926a848f4b18)
139
- - chore: remove commitizen [`540df34`](https://github.com/avil13/vue-act-master/commit/540df3477c2a3880a3fc26ea9ba28f63d943aa4a)
140
-
141
- #### [v0.15.2](https://github.com/avil13/vue-act-master/compare/v0.15.1...v0.15.2)
142
-
143
- > 6 December 2021
144
-
145
- - changelog(vue-act-master) [`551e096`](https://github.com/avil13/vue-act-master/commit/551e096a9c31648c30f0d6fcf314b9be5d0551ed)
146
- - doc(vue-act-master): fix readme [`1a79d1c`](https://github.com/avil13/vue-act-master/commit/1a79d1c55bb4714df4d436d7664790228001f5a9)
147
- - doc(act-master): fix readme [`96ed2ce`](https://github.com/avil13/vue-act-master/commit/96ed2ceea4a33026cc95857b7d5fdfce67d278b8)
148
-
149
- #### [v0.15.1](https://github.com/avil13/vue-act-master/compare/v0.11.2...v0.15.1)
150
-
151
- > 1 December 2021
152
-
153
- - chore: upgrade deps [`e0b2f9b`](https://github.com/avil13/vue-act-master/commit/e0b2f9bdd300539fdd6023652a67429155ce9e04)
154
- - feat: added size-limit library [`9dbc21b`](https://github.com/avil13/vue-act-master/commit/9dbc21ba36a917eb486a3de93bb1e82144ae8d4f)
155
- - doc: added title image [`47a5cbb`](https://github.com/avil13/vue-act-master/commit/47a5cbb3c6318536a9b481cfd6d3ae04cf1841a6)
156
-
157
- #### [v0.11.2](https://github.com/avil13/vue-act-master/compare/v0.9.8...v0.11.2)
158
-
159
- > 3 October 2021
160
-
161
- - Feat/progress [`#26`](https://github.com/avil13/vue-act-master/pull/26)
162
- - build(deps): bump tmpl from 1.0.4 to 1.0.5 [`#25`](https://github.com/avil13/vue-act-master/pull/25)
163
- - chore: removed unused packages [`04f38de`](https://github.com/avil13/vue-act-master/commit/04f38de4e233faab7027602439ded4cf759fa2c1)
164
- - chore: update deps [`277124b`](https://github.com/avil13/vue-act-master/commit/277124b67ce992809890781f9e372de30bbfbdfd)
165
- - wip(vue-act-master): added ActInProgress decoreator [`b77902c`](https://github.com/avil13/vue-act-master/commit/b77902c6069455e8bf65b043ae79464bbab146d2)
166
-
167
- #### [v0.9.8](https://github.com/avil13/vue-act-master/compare/v0.9.6...v0.9.8)
168
-
169
- > 6 July 2021
170
-
171
- - build(deps): bump ws from 7.4.5 to 7.5.0 [`#17`](https://github.com/avil13/vue-act-master/pull/17)
172
- - build(deps): bump postcss from 7.0.35 to 7.0.36 [`#18`](https://github.com/avil13/vue-act-master/pull/18)
173
- - fix(vue-act-master): fix ActSubscribe decorator [`582ff24`](https://github.com/avil13/vue-act-master/commit/582ff245fea82ffa822ff0236a7edb53598234b4)
174
- - feat(act-master): bump version 1.4.1 [`efcd46a`](https://github.com/avil13/vue-act-master/commit/efcd46a5b251524ff5ea5a9f9b759bd9075ebf2c)
175
- - feat(act-master): Added error handler on validation error & fix test-utils reset bug [`525660c`](https://github.com/avil13/vue-act-master/commit/525660c300065b2e6a93f9f459782c445935cf16)
176
-
177
- #### [v0.9.6](https://github.com/avil13/vue-act-master/compare/v0.9.3...v0.9.6)
178
-
179
- > 20 June 2021
180
-
181
- - feat(vue-act-master): nuxt fix module 4 [`8d86d18`](https://github.com/avil13/vue-act-master/commit/8d86d1866f08d2338132af70ca0ef2f1bb483526)
182
- - docs: vue-act-master doc nuxtjs [`9af0608`](https://github.com/avil13/vue-act-master/commit/9af0608e03eb2fb3bfa5e435108c9e7d2e5d24bf)
183
- - feat(vue-act-master): nuxt fix module 3 [`7d22c89`](https://github.com/avil13/vue-act-master/commit/7d22c89723218bee95c0d4da0fbe027c470001f9)
184
-
185
- #### [v0.9.3](https://github.com/avil13/vue-act-master/compare/v0.9.2...v0.9.3)
186
-
187
- > 8 May 2021
188
-
189
- - feat(vue-act-master): nuxt fix module 2 [`41a2444`](https://github.com/avil13/vue-act-master/commit/41a2444bdd01326a4e77b1dad1bcf1d11be23493)
190
-
191
- #### [v0.9.2](https://github.com/avil13/vue-act-master/compare/v0.9.1...v0.9.2)
192
-
193
- > 8 May 2021
194
-
195
- - docs: vue-act-master doc update [`98e6843`](https://github.com/avil13/vue-act-master/commit/98e6843bd68bbcd317b4938258e122fb6d6711d0)
196
- - feat(vue-act-master): nuxt fix module [`5ddf0a0`](https://github.com/avil13/vue-act-master/commit/5ddf0a0ccdaab523d0284659451de18332446090)
197
-
198
- #### [v0.9.1](https://github.com/avil13/vue-act-master/compare/v0.9.0...v0.9.1)
199
-
200
- > 7 May 2021
201
-
202
- - build(deps): bump ssri from 8.0.0 to 8.0.1 [`#14`](https://github.com/avil13/vue-act-master/pull/14)
203
- - docs: up vitepress [`29a78fa`](https://github.com/avil13/vue-act-master/commit/29a78fa474c9be104aceaf13d7bf7bde43661b9f)
204
- - chore(act-master): optimie build size [`dd3f8b1`](https://github.com/avil13/vue-act-master/commit/dd3f8b17b666bea9469e5b6b3482eed076971a78)
205
- - docs(tip): added websocket example [`f3632cf`](https://github.com/avil13/vue-act-master/commit/f3632cf1d8a7c1f6ec69b1ab4b0fde2e18d73a60)
206
-
207
- #### [v0.9.0](https://github.com/avil13/vue-act-master/compare/v0.8.8...v0.9.0)
208
-
209
- > 9 January 2021
210
-
211
- - feat(act-master): change listenera and action container to the Map [`f17df13`](https://github.com/avil13/vue-act-master/commit/f17df13ece0e5b9a7528811885ab692e7513a4ca)
212
- - fix: readme [`abfbc54`](https://github.com/avil13/vue-act-master/commit/abfbc5464654a4619533d22cc46d59437a14fc0d)
213
- - fix: repo in package.json [`2484a1f`](https://github.com/avil13/vue-act-master/commit/2484a1f9db9a1b5255b70c8104119b2ff3c99609)
214
-
215
- #### [v0.8.8](https://github.com/avil13/vue-act-master/compare/v0.8.6...v0.8.8)
216
-
217
- > 9 January 2021
218
-
219
- - build(deps): bump node-notifier from 8.0.0 to 8.0.1 [`#13`](https://github.com/avil13/vue-act-master/pull/13)
220
- - feat(docs): vitepress documentation [`14998c2`](https://github.com/avil13/vue-act-master/commit/14998c2981bcf1572f81350f26c4b2f8153d1491)
221
- - feat(docs): fixes [`ef6ed76`](https://github.com/avil13/vue-act-master/commit/ef6ed7680198533f09f0dd2bf33cc69071831085)
222
- - docs: logo and icons [`1920bae`](https://github.com/avil13/vue-act-master/commit/1920bae48f472c7fb444db13b6606016655433bc)
223
-
224
- #### [v0.8.6](https://github.com/avil13/vue-act-master/compare/v0.8.5...v0.8.6)
225
-
226
- > 29 December 2020
227
-
228
- - feat(act-master): added validateInput method [`08182c9`](https://github.com/avil13/vue-act-master/commit/08182c9f3825a64e50a6bd66c01f90eea896ec08)
229
- - feat(vue-act-master): up act-master to 1.3.0 [`7997f94`](https://github.com/avil13/vue-act-master/commit/7997f94769210de66259bf5091ecfcf4071f5b6c)
230
- - feat(act-master): bump version 1.3.0 [`b96c8ab`](https://github.com/avil13/vue-act-master/commit/b96c8ab86a03aa9286d3624466f70cc4f3743fb8)
231
-
232
- #### [v0.8.5](https://github.com/avil13/vue-act-master/compare/v0.8.4...v0.8.5)
233
-
234
- > 14 December 2020
235
-
236
- - build(deps): bump ini from 1.3.5 to 1.3.8 [`#10`](https://github.com/avil13/vue-act-master/pull/10)
237
- - Create LICENSE [`#8`](https://github.com/avil13/vue-act-master/pull/8)
238
- - feat(vue-act-master): auto-unsubscribe in vue3 [`41d3e3d`](https://github.com/avil13/vue-act-master/commit/41d3e3d9082de77a8419114448ec75fd43f632eb)
239
- - feat(act-master): version v1.2.2 [`8c889da`](https://github.com/avil13/vue-act-master/commit/8c889da733b4dec323463203d20e56557bdfc60c)
240
- - docs(vue-act-master): fix changelog [`b1ffd9b`](https://github.com/avil13/vue-act-master/commit/b1ffd9bef98d3f02f0ac7420544c78435cab01c6)
241
-
242
- #### [v0.8.4](https://github.com/avil13/vue-act-master/compare/v0.8.3...v0.8.4)
243
-
244
- > 5 November 2020
245
-
246
- - feat(act-master): fixed test-utils loading & added min version [`abb6b99`](https://github.com/avil13/vue-act-master/commit/abb6b998b45f015243ea93cd5daadd90c500f323)
247
- - fix(vue-act-master): version 0.8.3 [`df13fd7`](https://github.com/avil13/vue-act-master/commit/df13fd71b7e0a2aaa401439320e3e6f0e2b4063f)
248
- - feat(act-master): bump version 1.2.1 [`106afa3`](https://github.com/avil13/vue-act-master/commit/106afa325a0b45efc8e6bb0947c1bb3efc5a3ac0)
249
-
250
- #### [v0.8.3](https://github.com/avil13/vue-act-master/compare/v0.8.2...v0.8.3)
251
-
252
- > 4 November 2020
253
-
254
- - feat(vue-act-master): added test-utils [`81e0ecb`](https://github.com/avil13/vue-act-master/commit/81e0ecbf5750cfaf6ba101f989c08988051edcce)
255
- - feat(vue-act-master): bump version to v0.8.2 [`d642b67`](https://github.com/avil13/vue-act-master/commit/d642b67cbfac40ae8d052b54c1a6e9c774d93ade)
256
-
257
- #### [v0.8.2](https://github.com/avil13/vue-act-master/compare/v0.8.1...v0.8.2)
258
-
259
- > 4 November 2020
260
-
261
- - feat(act-master): added ActTest - helper class for unit tests [`5fa71eb`](https://github.com/avil13/vue-act-master/commit/5fa71eb6306de2267993cbf510fffb764cc06b64)
262
- - docs(vue-act-master): updated README & up version act-master to 1.2.0 [`8d5bc90`](https://github.com/avil13/vue-act-master/commit/8d5bc90ed2e589242813c34cad4fc59d0ec23223)
263
- - feat(act-master): bump version 1.2.0 [`fe78d07`](https://github.com/avil13/vue-act-master/commit/fe78d070497b4e65833e354a3284c36722fd1b8a)
264
-
265
- #### [v0.8.1](https://github.com/avil13/vue-act-master/compare/v0.7.1...v0.8.1)
266
-
267
- > 3 November 2020
268
-
269
- - feat(vue-act-master): wip - ActSubscribe decorator [`d86825a`](https://github.com/avil13/vue-act-master/commit/d86825abe690e8b4607e57807cf4d5bbfc3bb29e)
270
- - feat(vue-act-master): updated act-master to v1.1.2 [`59060b4`](https://github.com/avil13/vue-act-master/commit/59060b4e93104183068edd35cf079819ebf46ba1)
271
- - docs(vue-act-master): updated README [`ecfa39c`](https://github.com/avil13/vue-act-master/commit/ecfa39c249955f8f501ac55182f595e293b4ff73)
272
-
273
- #### [v0.7.1](https://github.com/avil13/vue-act-master/compare/v0.7.0...v0.7.1)
274
-
275
- > 3 November 2020
276
-
277
- - feat(vue-act-master): updated act-master to v1.1.0 [`eb58a61`](https://github.com/avil13/vue-act-master/commit/eb58a61261f0341b2a50b05bca81b4469344b3c1)
278
- - feat(act-master): eventAction arguments list [`801f3bb`](https://github.com/avil13/vue-act-master/commit/801f3bbeb270774af5da0bc14e221778890c3e48)
279
- - feat(vue-act-master): updated act-master to v1.1.1 [`52e26e5`](https://github.com/avil13/vue-act-master/commit/52e26e5878263f94a93a9b3c5ad8a82098cfbcb2)
280
-
281
- #### [v0.7.0](https://github.com/avil13/vue-act-master/compare/v0.6.4...v0.7.0)
282
-
283
- > 30 October 2020
284
-
285
- - feat(vue-act-master): updated act-master to v1.1.0 [`a392f75`](https://github.com/avil13/vue-act-master/commit/a392f758779e2f567f8c1d9dcabb35e04d17b8db)
286
- - feat(act-master): added commitezen [`0f335d4`](https://github.com/avil13/vue-act-master/commit/0f335d4e85b5ef7229659da0603af543a810df72)
287
- - feat(act-master): added "di" option and tests for constructor options [`f5549a5`](https://github.com/avil13/vue-act-master/commit/f5549a588d7adfa1e41fd888e8469f9d05848e8c)
288
-
289
- #### [v0.6.4](https://github.com/avil13/vue-act-master/compare/v0.6.3...v0.6.4)
290
-
291
- > 29 October 2020
292
-
293
- - feat(act-master): added "di" option and tests for constructor options
294
- - feat(vue-act-master): link to example page [`16049dc`](https://github.com/avil13/vue-act-master/commit/16049dceeeb5e4bcb1594b6d1d6683919ebd48af)
295
- - feat(vue-act-master): changelog [`77c6ddb`](https://github.com/avil13/vue-act-master/commit/77c6ddb541a07b62f27db6bdbc32eaf6d9a20829)
296
-
297
- #### [v0.6.3](https://github.com/avil13/vue-act-master/compare/v0.6.1...v0.6.3)
298
-
299
- > 28 October 2020
300
-
301
- - feat(act-master): CancelledAct method "is" [`fcd75ab`](https://github.com/avil13/vue-act-master/commit/fcd75abe135a4c61881f0b11766a56f45d1a9678)
302
- - fear(example): added example page [`c90d326`](https://github.com/avil13/vue-act-master/commit/c90d326dcad396ae7075c646404a528437bd3a2b)
303
- - feat(act-master): build script fixed [`8d6c25a`](https://github.com/avil13/vue-act-master/commit/8d6c25a885986bcd8e268917538f208e5a2b538d)
304
-
305
- #### [v0.6.1](https://github.com/avil13/vue-act-master/compare/v0.6.0...v0.6.1)
306
-
307
- > 28 October 2020
308
-
309
- - feat: update changelog command [`5075673`](https://github.com/avil13/vue-act-master/commit/50756734b83cf589d4858ab4a8e34d39d9a33719)
310
- - . [`140990e`](https://github.com/avil13/vue-act-master/commit/140990e33785b66b5d5d80ab081cb75a2426fd25)
311
- - chore: root repo scripts [`2607e3c`](https://github.com/avil13/vue-act-master/commit/2607e3c99b2d4cd241d1af383bf90dc84e93b078)
312
-
313
- #### [v0.6.0](https://github.com/avil13/vue-act-master/compare/v0.5.0...v0.6.0)
314
-
315
- > 25 October 2020
316
-
317
- - 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)
318
- - feat: add vue3 support [`e0281f3`](https://github.com/avil13/vue-act-master/commit/e0281f3fe03e14d7c1a72edecf06664442f7ce67)
319
-
320
- #### [v0.5.0](https://github.com/avil13/vue-act-master/compare/v0.3.1...v0.5.0)
321
-
322
- > 20 October 2020
323
-
324
- #### [v0.3.1](https://github.com/avil13/vue-act-master/compare/v0.3.0...v0.3.1)
325
-
326
- > 20 April 2022
327
-
328
- - build(deps): bump prismjs from 1.25.0 to 1.27.0 [`#28`](https://github.com/avil13/vue-act-master/pull/28)
329
- - build(deps): bump nanoid from 3.1.30 to 3.2.0 [`#27`](https://github.com/avil13/vue-act-master/pull/27)
330
- - Feat/progress [`#26`](https://github.com/avil13/vue-act-master/pull/26)
331
- - build(deps): bump tmpl from 1.0.4 to 1.0.5 [`#25`](https://github.com/avil13/vue-act-master/pull/25)
332
- - build(deps): bump ws from 7.4.5 to 7.5.0 [`#17`](https://github.com/avil13/vue-act-master/pull/17)
333
- - build(deps): bump postcss from 7.0.35 to 7.0.36 [`#18`](https://github.com/avil13/vue-act-master/pull/18)
334
- - build(deps): bump ssri from 8.0.0 to 8.0.1 [`#14`](https://github.com/avil13/vue-act-master/pull/14)
335
- - build(deps): bump node-notifier from 8.0.0 to 8.0.1 [`#13`](https://github.com/avil13/vue-act-master/pull/13)
336
- - build(deps): bump ini from 1.3.5 to 1.3.8 [`#10`](https://github.com/avil13/vue-act-master/pull/10)
337
- - Create LICENSE [`#8`](https://github.com/avil13/vue-act-master/pull/8)
338
- - 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)
339
- - wip: chrome-devtools [`f336e5d`](https://github.com/avil13/vue-act-master/commit/f336e5d0b3ac168c5c01390e8e4aa6c0fa18f9b5)
340
- - chore: removed unused packages [`04f38de`](https://github.com/avil13/vue-act-master/commit/04f38de4e233faab7027602439ded4cf759fa2c1)
341
- - feat: the division into packages 3 [`4188460`](https://github.com/avil13/vue-act-master/commit/4188460ef7c12800b99ca5dd603136078046dc9d)
342
-
343
- #### [v0.3.0](https://github.com/avil13/vue-act-master/compare/v0.2.1...v0.3.0)
344
-
345
- > 17 August 2020
346
-
347
- - feat: added Emit decorator [`8d43ca7`](https://github.com/avil13/vue-act-master/commit/8d43ca7aeddc8511ffea3ad978bad12d97b3ff05)
348
- - feat: added auto-changelog [`5a7a377`](https://github.com/avil13/vue-act-master/commit/5a7a37780b7d743e0f838627f39e4b614cb6f6db)
349
-
350
- #### [v0.2.1](https://github.com/avil13/vue-act-master/compare/v0.2.0...v0.2.1)
351
-
352
- > 16 August 2020
353
-
354
- - feat: removal of unnecessary code [`66b4021`](https://github.com/avil13/vue-act-master/commit/66b4021cfc20b86e185a16ae879702231026b192)
355
- - fix: fixed useDI method name [`3189c9f`](https://github.com/avil13/vue-act-master/commit/3189c9f355498bec11c5277d490fbc136f005f95)
356
-
357
- #### [v0.2.0](https://github.com/avil13/vue-act-master/compare/v0.1.2...v0.2.0)
358
-
359
- > 15 August 2020
360
-
361
- - feat: update dependencies [`#6`](https://github.com/avil13/vue-act-master/pull/6)
362
- - Bump elliptic from 6.5.2 to 6.5.3 [`#5`](https://github.com/avil13/vue-act-master/pull/5)
363
- - feat: added UseDI decorator [`3152f7e`](https://github.com/avil13/vue-act-master/commit/3152f7e7a0d9565b2fad1059e5c0ec60eb560a8e)
364
-
365
- #### [v0.1.2](https://github.com/avil13/vue-act-master/compare/v0.1.1...v0.1.2)
366
-
367
- > 31 July 2020
368
-
369
- - updated README [`a6d2c5a`](https://github.com/avil13/vue-act-master/commit/a6d2c5afb6074d23c72802dc398566502bd2a3d7)
370
- - chore: change the name properties [`f55920f`](https://github.com/avil13/vue-act-master/commit/f55920f219be64e5589336a31565f0bff3ae62fe)
371
-
372
- #### [v0.1.1](https://github.com/avil13/vue-act-master/compare/v0.1.0...v0.1.1)
373
-
374
- > 21 May 2020
375
-
376
- - fix useEmit cases [`d9673ea`](https://github.com/avil13/vue-act-master/commit/d9673ea9257e3117c393ca6193824a62c7ceb81e)
377
-
378
- #### [v0.1.0](https://github.com/avil13/vue-act-master/compare/v0.0.11...v0.1.0)
379
-
380
- > 16 May 2020
381
-
382
- - Added
383
- DI
384
- useEmit
385
- debounce
386
- - wip [`e72a93d`](https://github.com/avil13/vue-act-master/commit/e72a93d8d8db49cf9cb987013bccb4bb43aadcf2)
387
-
388
- #### [v0.0.11](https://github.com/avil13/vue-act-master/compare/v0.0.10...v0.0.11)
389
-
390
- > 3 May 2020
391
-
392
- - emitAction fix [`8f9c178`](https://github.com/avil13/vue-act-master/commit/8f9c17804dd3b9bfe8a42b483834d3f339bb11d8)
393
-
394
- #### [v0.0.10](https://github.com/avil13/vue-act-master/compare/v0.0.9...v0.0.10)
395
-
396
- > 3 May 2020
397
-
398
- - add emit and change subscribe [`e9e0fdf`](https://github.com/avil13/vue-act-master/commit/e9e0fdfd8ce032c1abc4e6a6f0a66229139fba84)
399
-
400
- #### [v0.0.9](https://github.com/avil13/vue-act-master/compare/v0.0.8...v0.0.9)
401
-
402
- > 3 May 2020
403
-
404
- - add setState method [`7a006b6`](https://github.com/avil13/vue-act-master/commit/7a006b6018d2f18c2dc2f2725354f608de564b23)
405
-
406
- #### [v0.0.8](https://github.com/avil13/vue-act-master/compare/v0.0.7...v0.0.8)
407
-
408
- > 3 May 2020
409
-
410
- - states [`e6cde84`](https://github.com/avil13/vue-act-master/commit/e6cde846ed32b2ae0efe53d0e921d4d06cec6dcc)
411
-
412
- #### [v0.0.7](https://github.com/avil13/vue-act-master/compare/v0.0.6...v0.0.7)
413
-
414
- > 2 May 2020
415
-
416
- - useVue method [`01d8a41`](https://github.com/avil13/vue-act-master/commit/01d8a41a26841707be635c1614f3faeac770c46e)
417
-
418
- #### [v0.0.6](https://github.com/avil13/vue-act-master/compare/v0.0.2...v0.0.6)
419
-
420
- > 2 May 2020
421
-
422
- - wip [`fb7b995`](https://github.com/avil13/vue-act-master/commit/fb7b995e039c7ea3ff46d075d32eebd611bcaca6)
423
- - remove saga [`20e292c`](https://github.com/avil13/vue-act-master/commit/20e292cf06b327e8e1135272d02c9bd606020d41)
424
- - nuxt [`05192bb`](https://github.com/avil13/vue-act-master/commit/05192bb754fc53dc8378e4e2dcff1496f6431221)
425
-
426
- #### v0.0.2
427
-
428
- > 2 April 2020
429
-
430
- - init [`b3fea4f`](https://github.com/avil13/vue-act-master/commit/b3fea4f252cec0904010eea73e2c7935038926ff)
431
- - wip saga [`c86f87f`](https://github.com/avil13/vue-act-master/commit/c86f87fbf8a62cc4278cb30fe678c88e26506e74)
432
- - update [`52ccb9b`](https://github.com/avil13/vue-act-master/commit/52ccb9bcb414f743f21c0ce705b0d5b8f74601d7)