@domql/event 2.31.28 → 2.31.30

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);
package/dist/esm/on.js CHANGED
@@ -34,6 +34,10 @@ const applyEvent = (fnValue, element, state, context, options) => {
34
34
  };
35
35
  const triggerEventOn = async (param, element, options) => {
36
36
  const appliedFunction = getOnOrPropsEvent(param, element);
37
+ const ref = element.__ref;
38
+ if (ref.__stormAbortion) {
39
+ return;
40
+ }
37
41
  if (appliedFunction) {
38
42
  const { state, context } = element;
39
43
  return await applyEvent(appliedFunction, element, state, context, options);
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/event",
3
- "version": "2.31.28",
3
+ "version": "2.31.30",
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.28",
32
- "@domql/utils": "^2.31.28"
31
+ "@domql/report": "^2.31.30",
32
+ "@domql/utils": "^2.31.30"
33
33
  },
34
- "gitHead": "62fc6275cd961fffd78b8f4c7474e10a61251c38"
34
+ "gitHead": "2cf6e94eae0ea19763d2acac8bebb9b640f4dceb"
35
35
  }