@domql/event 2.31.29 → 2.31.31

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/dist/cjs/on.js CHANGED
@@ -45,6 +45,10 @@ const applyEvent = (fnValue, element, state, context, options) => {
45
45
  };
46
46
  const triggerEventOn = async (param, element, options) => {
47
47
  const appliedFunction = getOnOrPropsEvent(param, element);
48
+ const ref = element.__ref;
49
+ if (ref.__stormAbortion) {
50
+ return;
51
+ }
48
52
  if (appliedFunction) {
49
53
  const { state, context } = element;
50
54
  return await applyEvent(appliedFunction, element, state, context, options);
@@ -72,7 +76,7 @@ const triggerEventOnUpdate = async (param, updatedObj, element, options) => {
72
76
  element,
73
77
  state,
74
78
  context,
75
- { calleeElement: element, ...options }
79
+ options
76
80
  );
77
81
  }
78
82
  };
package/dist/esm/on.js CHANGED
@@ -1,19 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
- var __hasOwnProp = Object.prototype.hasOwnProperty;
4
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __spreadValues = (a, b) => {
7
- for (var prop in b || (b = {}))
8
- if (__hasOwnProp.call(b, prop))
9
- __defNormalProp(a, prop, b[prop]);
10
- if (__getOwnPropSymbols)
11
- for (var prop of __getOwnPropSymbols(b)) {
12
- if (__propIsEnum.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- }
15
- return a;
16
- };
17
1
  import { isFunction, isString, getContextFunction } from "@domql/utils";
18
2
  const getOnOrPropsEvent = (param, element) => {
19
3
  var _a, _b;
@@ -34,6 +18,10 @@ const applyEvent = (fnValue, element, state, context, options) => {
34
18
  };
35
19
  const triggerEventOn = async (param, element, options) => {
36
20
  const appliedFunction = getOnOrPropsEvent(param, element);
21
+ const ref = element.__ref;
22
+ if (ref.__stormAbortion) {
23
+ return;
24
+ }
37
25
  if (appliedFunction) {
38
26
  const { state, context } = element;
39
27
  return await applyEvent(appliedFunction, element, state, context, options);
@@ -61,7 +49,7 @@ const triggerEventOnUpdate = async (param, updatedObj, element, options) => {
61
49
  element,
62
50
  state,
63
51
  context,
64
- __spreadValues({ calleeElement: element }, options)
52
+ options
65
53
  );
66
54
  }
67
55
  };
package/on.js CHANGED
@@ -13,10 +13,6 @@ export const applyEvent = (fnValue, element, state, context, options) => {
13
13
  if (isString(fnValue)) fnValue = getContextFunction.call(element, fnValue)
14
14
  if (!fnValue.call) element.warn(`Event is not executable: ${fnValue}`)
15
15
 
16
- // console.log('2.1. applyEvent:')
17
- // console.log(element.__ref.path?.join('.'))
18
- // console.log(element, options)
19
-
20
16
  return fnValue.call(
21
17
  element,
22
18
  element,
@@ -29,9 +25,11 @@ export const applyEvent = (fnValue, element, state, context, options) => {
29
25
  export const triggerEventOn = async (param, element, options) => {
30
26
  const appliedFunction = getOnOrPropsEvent(param, element)
31
27
 
32
- // console.log('----')
33
- // console.log('1. trigger update', param)
34
- // console.log(element, options, options.calleeElement)
28
+ // prevent update storm
29
+ const ref = element.__ref
30
+ if (ref.__stormAbortion) {
31
+ return
32
+ }
35
33
 
36
34
  if (appliedFunction) {
37
35
  const { state, context } = element
@@ -50,10 +48,6 @@ export const applyEventUpdate = (
50
48
  if (isString(fnValue)) fnValue = getContextFunction.call(element, fnValue)
51
49
  if (!fnValue.call) element.warn(`Event is not executable: ${fnValue}`)
52
50
 
53
- // console.log('2.1. applyEventUpdate:')
54
- // console.log(element.__ref.path?.join('.'))
55
- // console.log(element, options)
56
-
57
51
  return fnValue.call(
58
52
  element,
59
53
  updatedObj,
@@ -70,10 +64,6 @@ export const triggerEventOnUpdate = async (
70
64
  element,
71
65
  options
72
66
  ) => {
73
- // console.log('----')
74
- // console.log('2. trigger update', param)
75
- // console.log(element, options, options.calleeElement)
76
-
77
67
  const appliedFunction = getOnOrPropsEvent(param, element)
78
68
  if (appliedFunction) {
79
69
  const { state, context } = element
@@ -83,7 +73,7 @@ export const triggerEventOnUpdate = async (
83
73
  element,
84
74
  state,
85
75
  context,
86
- { calleeElement: element, ...options }
76
+ options
87
77
  )
88
78
  }
89
79
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/event",
3
- "version": "2.31.29",
3
+ "version": "2.31.31",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "index.js",
@@ -28,8 +28,8 @@
28
28
  "prepublish": "npm run build; npm run copy:package:cjs"
29
29
  },
30
30
  "dependencies": {
31
- "@domql/report": "^2.31.29",
32
- "@domql/utils": "^2.31.29"
31
+ "@domql/report": "^2.31.31",
32
+ "@domql/utils": "^2.31.31"
33
33
  },
34
- "gitHead": "d3448573587cb660e73fd460beb38707643c8e5c"
34
+ "gitHead": "a87c7ae3e84fbab1a9ee130d6d03f384e94260ab"
35
35
  }