@instantdb/react-common 0.22.95 → 0.22.96-experimental.add-posthog-frontend.20386914944.1
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/commonjs/InstantReactAbstractDatabase.d.ts +0 -1
- package/dist/commonjs/InstantReactAbstractDatabase.d.ts.map +1 -1
- package/dist/commonjs/InstantReactAbstractDatabase.js +17 -21
- package/dist/commonjs/InstantReactAbstractDatabase.js.map +1 -1
- package/dist/commonjs/useQuery.d.ts.map +1 -1
- package/dist/commonjs/useQuery.js +0 -4
- package/dist/commonjs/useQuery.js.map +1 -1
- package/dist/esm/InstantReactAbstractDatabase.d.ts +0 -1
- package/dist/esm/InstantReactAbstractDatabase.d.ts.map +1 -1
- package/dist/esm/InstantReactAbstractDatabase.js +17 -21
- package/dist/esm/InstantReactAbstractDatabase.js.map +1 -1
- package/dist/esm/useQuery.d.ts.map +1 -1
- package/dist/esm/useQuery.js +0 -4
- package/dist/esm/useQuery.js.map +1 -1
- package/dist/standalone/index.js +718 -774
- package/dist/standalone/index.umd.cjs +10 -10
- package/package.json +3 -3
- package/src/InstantReactAbstractDatabase.tsx +2 -6
- package/src/useQuery.ts +2 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instantdb/react-common",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.96-experimental.add-posthog-frontend.20386914944.1",
|
|
4
4
|
"description": "Instant DB shared components for React and React Native",
|
|
5
5
|
"homepage": "https://github.com/instantdb/instant/tree/main/client/packages/react-common",
|
|
6
6
|
"repository": {
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"react": ">=16"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@instantdb/core": "0.22.
|
|
57
|
-
"@instantdb/version": "0.22.
|
|
56
|
+
"@instantdb/core": "0.22.96-experimental.add-posthog-frontend.20386914944.1",
|
|
57
|
+
"@instantdb/version": "0.22.96-experimental.add-posthog-frontend.20386914944.1"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"test": "vitest",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
'use client';
|
|
2
1
|
import {
|
|
3
2
|
// types
|
|
4
3
|
Auth,
|
|
@@ -9,6 +8,7 @@ import {
|
|
|
9
8
|
type ConnectionStatus,
|
|
10
9
|
type TransactionChunk,
|
|
11
10
|
type RoomSchemaShape,
|
|
11
|
+
type InstaQLParams,
|
|
12
12
|
type InstaQLOptions,
|
|
13
13
|
type InstantConfig,
|
|
14
14
|
type PageInfoResponse,
|
|
@@ -241,10 +241,6 @@ export default abstract class InstantReactAbstractDatabase<
|
|
|
241
241
|
*
|
|
242
242
|
*/
|
|
243
243
|
useAuth = (): AuthState => {
|
|
244
|
-
return this._useAuth();
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
protected _useAuth(): AuthState {
|
|
248
244
|
// We use a ref to store the result of the query.
|
|
249
245
|
// This is becuase `useSyncExternalStore` uses `Object.is`
|
|
250
246
|
// to compare the previous and next state.
|
|
@@ -271,7 +267,7 @@ export default abstract class InstantReactAbstractDatabase<
|
|
|
271
267
|
() => defaultAuthState,
|
|
272
268
|
);
|
|
273
269
|
return state;
|
|
274
|
-
}
|
|
270
|
+
};
|
|
275
271
|
|
|
276
272
|
/**
|
|
277
273
|
* Subscribe to the currently logged in user.
|
package/src/useQuery.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
weakHash,
|
|
3
3
|
coerceQuery,
|
|
4
|
+
type InstaQLParams,
|
|
4
5
|
type InstaQLOptions,
|
|
6
|
+
type InstantGraph,
|
|
5
7
|
InstantCoreDatabase,
|
|
6
8
|
InstaQLLifecycleState,
|
|
7
9
|
InstantSchemaDef,
|
|
@@ -61,10 +63,6 @@ export function useQueryInternal<
|
|
|
61
63
|
resultCacheRef.current = stateForResult(
|
|
62
64
|
_core._reactor.getPreviousResult(query),
|
|
63
65
|
);
|
|
64
|
-
// before the subscribeQuery is connected and calls it's own callback,
|
|
65
|
-
// we might have data in the store via SSR, we need to notify useSyncExternalStore that
|
|
66
|
-
// the data has changed.
|
|
67
|
-
cb();
|
|
68
66
|
|
|
69
67
|
// Don't subscribe if query is null
|
|
70
68
|
if (!query) {
|