You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Streams the diff of two object lists, ideal for large lists and maximum performance.
316
316
317
+
ℹ️ `streamListDiff` requires ESM support for browser usage. It will work out of the box if you use a modern bundler (Webpack, Rollup) or JavaScript framework (Next.js, Vue.js).
318
+
317
319
#### FORMAT
318
320
319
321
**Input**
@@ -330,6 +332,8 @@ Streams the diff of two object lists, ideal for large lists and maximum performa
330
332
showOnly?: ("added"|"deleted"|"moved"|"updated"|"equal")[], // [] by default
331
333
chunksSize?:number, // 0 by default
332
334
considerMoveAsUpdate?:boolean; // false by default
335
+
useWorker?:boolean; // true by default
336
+
showWarnings?:boolean; // true by default
333
337
}
334
338
```
335
339
@@ -345,6 +349,9 @@ Streams the diff of two object lists, ideal for large lists and maximum performa
345
349
showOnly?: ("added"|"deleted"|"moved"|"updated"|"equal")[], // [] by default
346
350
chunksSize?:number, // 0 by default
347
351
considerMoveAsUpdate?:boolean; // false by default
352
+
useWorker?:boolean; // true by default
353
+
showWarnings?:boolean; // true by default
354
+
348
355
}
349
356
```
350
357
@@ -355,6 +362,10 @@ Streams the diff of two object lists, ideal for large lists and maximum performa
355
362
-`chunksSize` the number of object diffs returned by each streamed chunk. (e.g. `0` = 1 object diff per chunk, `10` = 10 object diffs per chunk).
356
363
-`showOnly` gives you the option to return only the values whose status you are interested in (e.g. `["added", "equal"]`).
357
364
-`considerMoveAsUpdate`: if set to `true` a `moved` value will be considered as `updated`.
365
+
-`useWorker`: if set to `true`, the diff will be run in a worker for maximum performance. Only recommended for large lists (e.g. +100,000 items).
366
+
-`showWarnings`: if set to `true`, potential warnings will be displayed in the console.
367
+
368
+
> ⚠️ Warning: using Readable streams may impact workers' performance since they need to be converted to arrays. Consider using arrays or files for optimal performance. Alternatively, you can turn the `useWorker` option off.
358
369
359
370
**Output**
360
371
@@ -364,20 +375,12 @@ The objects diff are grouped into arrays - called `chunks` - and are consumed th
364
375
-`error`: to be notified if an error occurs during the stream.
0 commit comments