@wovin/core 0.1.32 → 0.1.34

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.
@@ -47,7 +47,7 @@ import {
47
47
  withAg,
48
48
  withPvFrom,
49
49
  withTs
50
- } from "./chunk-C72WHVW4.min.js";
50
+ } from "./chunk-CDYQMETJ.min.js";
51
51
  import "./chunk-HYMC7W6S.min.js";
52
52
  import "./chunk-QO2KMGDN.min.js";
53
53
  import "./chunk-KEHU7HGZ.min.js";
@@ -2,7 +2,7 @@ import {
2
2
  cyrb53hash,
3
3
  ensureTsPvAndFinalizeApplog,
4
4
  g
5
- } from "./chunk-C72WHVW4.min.js";
5
+ } from "./chunk-CDYQMETJ.min.js";
6
6
 
7
7
  // src/pubsub/pub-pull.ts
8
8
  var { WARN, LOG, DEBUG, VERBOSE, ERROR } = g.setup(g.INFO);
@@ -37,4 +37,4 @@ export {
37
37
  isSubscription,
38
38
  agentToShortHash
39
39
  };
40
- //# sourceMappingURL=chunk-KYGGB5YI.min.js.map
40
+ //# sourceMappingURL=chunk-2UDZBFG2.min.js.map
@@ -4,7 +4,7 @@ import {
4
4
  createDebugName,
5
5
  g,
6
6
  observableArrayMap
7
- } from "./chunk-C72WHVW4.min.js";
7
+ } from "./chunk-CDYQMETJ.min.js";
8
8
  import {
9
9
  autorun,
10
10
  comparer,
@@ -62,4 +62,4 @@ export {
62
62
  includes,
63
63
  includedIn
64
64
  };
65
- //# sourceMappingURL=chunk-5NT4YV7V.min.js.map
65
+ //# sourceMappingURL=chunk-3PE2HQMQ.min.js.map
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  unchunkApplogsBlock
3
- } from "./chunk-7X3H5GWS.min.js";
3
+ } from "./chunk-HBM5NT6I.min.js";
4
4
  import {
5
5
  CID,
6
6
  areCidsEqual,
7
7
  decode,
8
8
  g,
9
9
  removeDuplicateAppLogs
10
- } from "./chunk-C72WHVW4.min.js";
10
+ } from "./chunk-CDYQMETJ.min.js";
11
11
 
12
12
  // src/retrieve/update-thread.ts
13
13
  var { WARN, LOG, DEBUG, VERBOSE, ERROR } = g.setup(g.INFO);
@@ -141,4 +141,4 @@ export {
141
141
  withBlockCache,
142
142
  updateThreadFromSnapshot
143
143
  };
144
- //# sourceMappingURL=chunk-HUW2UX6X.min.js.map
144
+ //# sourceMappingURL=chunk-6BBJHSBP.min.js.map
@@ -6202,6 +6202,7 @@ var Thread = class {
6202
6202
  // applogs: computed, //observable.shallow,
6203
6203
  // applogsSorted: computed,
6204
6204
  applogsCids: computed,
6205
+ applogsCidSet: computed,
6205
6206
  applogsByCid: computed,
6206
6207
  insert: action,
6207
6208
  size: computed,
@@ -6253,6 +6254,9 @@ var Thread = class {
6253
6254
  get applogsCids() {
6254
6255
  return this._applogs.map((l2) => l2.cid);
6255
6256
  }
6257
+ get applogsCidSet() {
6258
+ return new Set(this._applogs.map((l2) => l2.cid));
6259
+ }
6256
6260
  map(fn) {
6257
6261
  return this.applogs.map(fn);
6258
6262
  }
@@ -6277,7 +6281,7 @@ var Thread = class {
6277
6281
  }
6278
6282
  }
6279
6283
  hasApplogCid(cid) {
6280
- return this.applogsCids.includes(cid.toString());
6284
+ return this.applogsCidSet.has(cid.toString());
6281
6285
  }
6282
6286
  get applogsByCid() {
6283
6287
  return new Map(this.applogs.map((log) => [log.cid, log]));
@@ -8705,6 +8709,8 @@ var WriteableThread = class extends Thread {
8705
8709
  super(name2, null, filters, applogs);
8706
8710
  makeObservable(this, {
8707
8711
  // (i) all fields handled in parent
8712
+ insertRaw: action,
8713
+ purge: action
8708
8714
  });
8709
8715
  }
8710
8716
  purge(cidsToPurge) {
@@ -8787,7 +8793,10 @@ var WriteableThread = class extends Thread {
8787
8793
  sortApplogsByTs(appLogsToInsert);
8788
8794
  const sortNeeded = this._applogs.length && isTsBefore(appLogsToInsert[0], this._applogs[this._applogs.length - 1]);
8789
8795
  DEBUG8(`[WriteableThread.insertRaw] About to push to _applogs array`);
8790
- this._applogs.push(...appLogsToInsert);
8796
+ const CHUNK_SIZE = 5e4;
8797
+ for (let i = 0; i < appLogsToInsert.length; i += CHUNK_SIZE) {
8798
+ this._applogs.push(...appLogsToInsert.slice(i, i + CHUNK_SIZE));
8799
+ }
8791
8800
  if (sortNeeded) {
8792
8801
  DEBUG8(`[WriteableThread.insertRaw] About to sort _applogs (sortNeeded=true)`);
8793
8802
  sortApplogsByTs(this._applogs);
@@ -9055,4 +9064,4 @@ lodash-es/lodash.js:
9055
9064
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
9056
9065
  *)
9057
9066
  */
9058
- //# sourceMappingURL=chunk-C72WHVW4.min.js.map
9067
+ //# sourceMappingURL=chunk-CDYQMETJ.min.js.map