@absolutejs/sync 1.24.0 → 2.0.0

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.
@@ -1740,7 +1740,11 @@ var createSyncEngine = (options = {}) => {
1740
1740
  }
1741
1741
  const broadcast = (changes, originVersion) => {
1742
1742
  if (clusterBus !== undefined && changes.length > 0) {
1743
- clusterBus.publish({ changes, origin: instanceId, originVersion });
1743
+ clusterBus.publish({
1744
+ changes,
1745
+ origin: instanceId,
1746
+ originVersion
1747
+ });
1744
1748
  }
1745
1749
  };
1746
1750
  const subsFor = (collection) => {
@@ -2503,7 +2507,14 @@ var createSyncEngine = (options = {}) => {
2503
2507
  registerSearch: (collection) => {
2504
2508
  registry.set(collection.name, collection);
2505
2509
  },
2506
- subscribe: async ({ collection, params, ctx, onDiff, since, signal }) => {
2510
+ subscribe: async ({
2511
+ collection,
2512
+ params,
2513
+ ctx,
2514
+ onDiff,
2515
+ since,
2516
+ signal
2517
+ }) => {
2507
2518
  const subscribeSpan = tracer.startSpan("sync.subscribe", {
2508
2519
  attributes: {
2509
2520
  [ABS_ATTRS.engineId]: instanceId,
@@ -2532,7 +2543,10 @@ var createSyncEngine = (options = {}) => {
2532
2543
  releaseSubscriptionSlot(tenantSlot);
2533
2544
  innerUnsubscribe();
2534
2545
  };
2535
- const wrapped = { ...sub, unsubscribe: wrappedUnsubscribe };
2546
+ const wrapped = {
2547
+ ...sub,
2548
+ unsubscribe: wrappedUnsubscribe
2549
+ };
2536
2550
  linkAbortToUnsubscribe(signal, wrappedUnsubscribe);
2537
2551
  slotHandedOff = true;
2538
2552
  return wrapped;
@@ -2567,7 +2581,9 @@ var createSyncEngine = (options = {}) => {
2567
2581
  const scopedTable = tables.length === 1 ? tables[0] : undefined;
2568
2582
  const readRule = scopedTable !== undefined ? readRuleFor(scopedTable) : undefined;
2569
2583
  const rehydrate = async () => {
2570
- const raw = [...await definition.hydrate(params, ctx)];
2584
+ const raw = [
2585
+ ...await definition.hydrate(params, ctx)
2586
+ ];
2571
2587
  const rows = scopedTable !== undefined ? raw.map((row) => migrateRow(scopedTable, row)) : raw;
2572
2588
  return readRule ? rows.filter((row) => readRule(ctx, row)) : rows;
2573
2589
  };
@@ -3122,7 +3138,10 @@ var createSyncEngine = (options = {}) => {
3122
3138
  activeFences.add(handle);
3123
3139
  return handle;
3124
3140
  },
3125
- exportSnapshot: async ({ tables, ctx = {} } = {}) => {
3141
+ exportSnapshot: async ({
3142
+ tables,
3143
+ ctx = {}
3144
+ } = {}) => {
3126
3145
  const tableFilter = tables !== undefined ? new Set(tables) : undefined;
3127
3146
  const rows = {};
3128
3147
  for (const [table, reader] of readers) {
@@ -3750,5 +3769,5 @@ export {
3750
3769
  CdcConsumerSlowError
3751
3770
  };
3752
3771
 
3753
- //# debugId=A8C35E8D4A587BE064756E2164756E21
3772
+ //# debugId=6D23BAC246E5201264756E2164756E21
3754
3773
  //# sourceMappingURL=index.js.map