@pol-studios/db 1.0.56 → 1.0.57
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.
|
@@ -1499,7 +1499,7 @@ function createPowerSyncAdapter(db, schema) {
|
|
|
1499
1499
|
}
|
|
1500
1500
|
|
|
1501
1501
|
// src/providers/DataLayerProvider.tsx
|
|
1502
|
-
import { useState, useEffect, useMemo, useCallback, useRef, useContext } from "react";
|
|
1502
|
+
import { useState, useEffect, useLayoutEffect, useMemo, useCallback, useRef, useContext } from "react";
|
|
1503
1503
|
import { jsx } from "react/jsx-runtime";
|
|
1504
1504
|
var defaultSyncStatus = {
|
|
1505
1505
|
isConnected: false,
|
|
@@ -1554,8 +1554,10 @@ function DataLayerProvider({
|
|
|
1554
1554
|
}
|
|
1555
1555
|
const [registry] = useState(() => createAdapterRegistry(config));
|
|
1556
1556
|
const powerSyncInstanceRef = useRef(powerSyncInstance);
|
|
1557
|
-
|
|
1558
|
-
|
|
1557
|
+
useLayoutEffect(() => {
|
|
1558
|
+
powerSyncInstanceRef.current = powerSyncInstance;
|
|
1559
|
+
registry.setPowerSyncGetter(() => powerSyncInstanceRef.current, (db) => createPowerSyncAdapter(db, config.schema));
|
|
1560
|
+
}, [powerSyncInstance, registry, config.schema]);
|
|
1559
1561
|
const resolvedSyncControl = useMemo(() => externalSyncControl ?? defaultSyncControl, [externalSyncControl]);
|
|
1560
1562
|
const [isInitializedOnce, setIsInitializedOnce] = useState(false);
|
|
1561
1563
|
const [autoDetector, setAutoDetector] = useState(null);
|
|
@@ -5066,4 +5068,4 @@ object-assign/index.js:
|
|
|
5066
5068
|
@license MIT
|
|
5067
5069
|
*)
|
|
5068
5070
|
*/
|
|
5069
|
-
//# sourceMappingURL=chunk-
|
|
5071
|
+
//# sourceMappingURL=chunk-VSJKGPRI.js.map
|