tanstack-db-pglite 1.1.7 → 1.1.8

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/dist/drizzle.js CHANGED
@@ -92,7 +92,6 @@ export function drizzleCollectionOptions({ startSync = true, ...config }) {
92
92
  sync: {
93
93
  sync: (params) => {
94
94
  resolveSyncParams(params);
95
- resolvers = Promise.withResolvers();
96
95
  (async () => {
97
96
  try {
98
97
  await config.prepare?.();
@@ -104,6 +103,7 @@ export function drizzleCollectionOptions({ startSync = true, ...config }) {
104
103
  });
105
104
  params.commit();
106
105
  if (config.sync && startSync) {
106
+ resolvers = Promise.withResolvers();
107
107
  await config.sync(await getSyncParams());
108
108
  resolvers.resolve(undefined);
109
109
  }
@@ -155,7 +155,9 @@ export function drizzleCollectionOptions({ startSync = true, ...config }) {
155
155
  const params = await getSyncParams();
156
156
  // To wait the first sync
157
157
  await params.collection.stateWhenReady();
158
+ resolvers = Promise.withResolvers();
158
159
  await config.sync(params);
160
+ resolvers.resolve(undefined);
159
161
  },
160
162
  waitForSync: async () => {
161
163
  await resolvers.promise;
package/dist/sql.js CHANGED
@@ -79,7 +79,6 @@ export function sqlCollectionOptions({ startSync = true, ...config }) {
79
79
  sync: {
80
80
  sync: (params) => {
81
81
  resolveSyncParams(params);
82
- resolvers = Promise.withResolvers();
83
82
  (async () => {
84
83
  try {
85
84
  await config.prepare?.();
@@ -90,6 +89,7 @@ export function sqlCollectionOptions({ startSync = true, ...config }) {
90
89
  });
91
90
  params.commit();
92
91
  if (config.sync && startSync) {
92
+ resolvers = Promise.withResolvers();
93
93
  await config.sync(await getSyncParams());
94
94
  resolvers.resolve(undefined);
95
95
  }
@@ -137,7 +137,9 @@ export function sqlCollectionOptions({ startSync = true, ...config }) {
137
137
  }
138
138
  const params = await getSyncParams();
139
139
  await params.collection.stateWhenReady();
140
+ resolvers = Promise.withResolvers();
140
141
  await config.sync(params);
142
+ resolvers.resolve(undefined);
141
143
  },
142
144
  waitForSync: async () => {
143
145
  await resolvers.promise;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tanstack-db-pglite",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "packageManager": "pnpm@10.32.1",
5
5
  "description": "",
6
6
  "author": "Valerii Strilets",