native-document 1.0.24 → 1.0.25

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-document",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -139,8 +139,9 @@ export function ForEachArray(data, callback, key, configs = {}) {
139
139
  return fragment;
140
140
  },
141
141
  add(items, delay = 0) {
142
+ const fragment = Actions.toFragment(items);
142
143
  setTimeout(() => {
143
- element.appendElement(Actions.toFragment(items))
144
+ element.appendElement(fragment);
144
145
  }, delay);
145
146
  },
146
147
  replace(items) {
@@ -253,26 +254,23 @@ export function ForEachArray(data, callback, key, configs = {}) {
253
254
  };
254
255
 
255
256
  const buildContent = (items, _, operations) => {
256
- if(operations?.action === 'populate') {
257
- Actions.populate(operations.args, operations.result);
258
- } else {
259
- if(operations.action === 'clear' || !items.length) {
260
- if(lastNumberOfItems === 0) {
261
- return;
262
- }
263
- clear();
257
+ if(operations.action === 'clear' || !items.length) {
258
+ if(lastNumberOfItems === 0) {
259
+ return;
264
260
  }
261
+ clear();
262
+ return;
263
+ }
265
264
 
266
- if(!operations?.action) {
267
- if(lastNumberOfItems === 0) {
268
- Actions.add(items);
269
- return;
270
- }
271
- Actions.replace(items);
272
- }
273
- else if(Actions[operations.action]) {
274
- Actions[operations.action](operations.args, operations.result);
265
+ if(!operations?.action) {
266
+ if(lastNumberOfItems === 0) {
267
+ Actions.add(items);
268
+ return;
275
269
  }
270
+ Actions.replace(items);
271
+ }
272
+ else if(Actions[operations.action]) {
273
+ Actions[operations.action](operations.args, operations.result);
276
274
  }
277
275
 
278
276
  updateIndexObservers(items, 0);