@livestore/react 0.4.0-dev.3 → 0.4.0-dev.5
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/.tsbuildinfo +1 -1
- package/dist/LiveStoreProvider.d.ts +1 -3
- package/dist/LiveStoreProvider.d.ts.map +1 -1
- package/dist/LiveStoreProvider.js +2 -2
- package/dist/LiveStoreProvider.js.map +1 -1
- package/dist/LiveStoreProvider.test.js +1 -1
- package/dist/LiveStoreProvider.test.js.map +1 -1
- package/dist/useClientDocument.d.ts.map +1 -1
- package/dist/useClientDocument.js +1 -2
- package/dist/useClientDocument.js.map +1 -1
- package/dist/useClientDocument.test.js +3 -2
- package/dist/useClientDocument.test.js.map +1 -1
- package/dist/useQuery.d.ts.map +1 -1
- package/dist/useQuery.js +1 -2
- package/dist/useQuery.js.map +1 -1
- package/package.json +12 -12
- package/src/LiveStoreProvider.test.tsx +1 -1
- package/src/LiveStoreProvider.tsx +4 -3
- package/src/__snapshots__/useClientDocument.test.tsx.snap +208 -100
- package/src/__snapshots__/useQuery.test.tsx.snap +388 -116
- package/src/useClientDocument.test.tsx +3 -2
- package/src/useClientDocument.ts +1 -2
- package/src/useQuery.ts +1 -2
@@ -1,7 +1,7 @@
|
|
1
1
|
/** biome-ignore-all lint/a11y/useValidAriaRole: not needed for testing */
|
2
2
|
/** biome-ignore-all lint/a11y/noStaticElementInteractions: not needed for testing */
|
3
3
|
import * as LiveStore from '@livestore/livestore'
|
4
|
-
import { getSimplifiedRootSpan } from '@livestore/livestore/internal/testing-utils'
|
4
|
+
import { getAllSimplifiedRootSpans, getSimplifiedRootSpan } from '@livestore/livestore/internal/testing-utils'
|
5
5
|
import { Effect, ReadonlyRecord, Schema } from '@livestore/utils/effect'
|
6
6
|
import { Vitest } from '@livestore/utils-dev/node-vitest'
|
7
7
|
import * as otel from '@opentelemetry/api'
|
@@ -323,7 +323,8 @@ Vitest.describe('useClientDocument', () => {
|
|
323
323
|
})
|
324
324
|
}
|
325
325
|
|
326
|
-
expect(getSimplifiedRootSpan(exporter, mapAttributes)).toMatchSnapshot()
|
326
|
+
expect(getSimplifiedRootSpan(exporter, 'createStore', mapAttributes)).toMatchSnapshot()
|
327
|
+
expect(getAllSimplifiedRootSpans(exporter, 'LiveStore:commit', mapAttributes)).toMatchSnapshot()
|
327
328
|
|
328
329
|
await provider.shutdown()
|
329
330
|
},
|
package/src/useClientDocument.ts
CHANGED
@@ -105,8 +105,7 @@ export const useClientDocument: {
|
|
105
105
|
const tableName = table.sqliteDef.name
|
106
106
|
|
107
107
|
const store =
|
108
|
-
storeArg?.store ??
|
109
|
-
// biome-ignore lint/correctness/useHookAtTopLevel: store is stable
|
108
|
+
storeArg?.store ?? // biome-ignore lint/correctness/useHookAtTopLevel: store is stable
|
110
109
|
React.useContext(LiveStoreContext)?.store ??
|
111
110
|
shouldNeverHappen(`No store provided to useClientDocument`)
|
112
111
|
|
package/src/useQuery.ts
CHANGED
@@ -42,8 +42,7 @@ export const useQueryRef = <TQuery extends LiveQueryDef.Any>(
|
|
42
42
|
queryRcRef: LiveQueries.RcRef<LiveQuery<LiveQueries.GetResult<TQuery>>>
|
43
43
|
} => {
|
44
44
|
const store =
|
45
|
-
options?.store ??
|
46
|
-
// biome-ignore lint/correctness/useHookAtTopLevel: store is stable
|
45
|
+
options?.store ?? // biome-ignore lint/correctness/useHookAtTopLevel: store is stable
|
47
46
|
React.useContext(LiveStoreContext)?.store ??
|
48
47
|
shouldNeverHappen(`No store provided to useQuery`)
|
49
48
|
|