@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.
@@ -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
  },
@@ -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