@domql/state 2.5.90 → 2.5.93

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.
@@ -36,6 +36,8 @@ const STATE_UPDATE_OPTIONS = {
36
36
  const updateState = function(obj, options = STATE_UPDATE_OPTIONS) {
37
37
  const state = this;
38
38
  const element = state.__element;
39
+ if (options.onEach)
40
+ options.onEach(element, state, element.context, options);
39
41
  if (!options.updateByState)
40
42
  (0, import_utils.merge)(options, STATE_UPDATE_OPTIONS);
41
43
  if (!state.__element)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/state",
3
- "version": "2.5.90",
3
+ "version": "2.5.93",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "dist/esm/index.js",
@@ -31,5 +31,5 @@
31
31
  "@domql/report": "latest",
32
32
  "@domql/utils": "latest"
33
33
  },
34
- "gitHead": "01113bfc2fb3bc1f4fc3b694a45cb397ee65ae68"
34
+ "gitHead": "6c5a9e10c74137700ad69ff9108b6ccc09745cc7"
35
35
  }
package/updateState.js CHANGED
@@ -18,6 +18,8 @@ export const updateState = function (obj, options = STATE_UPDATE_OPTIONS) {
18
18
  const state = this
19
19
  const element = state.__element
20
20
 
21
+ if (options.onEach) options.onEach(element, state, element.context, options)
22
+
21
23
  if (!options.updateByState) merge(options, STATE_UPDATE_OPTIONS)
22
24
 
23
25
  if (!state.__element) report('ElementOnStateIsNotDefined')