@livequery/react 2.0.105 → 2.0.107

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/README.md CHANGED
@@ -45,13 +45,13 @@ npm install @livequery/react @livequery/client react rxjs
45
45
  import { LivequeryClient } from '@livequery/client'
46
46
  import { LivequeryClientProvider } from '@livequery/react'
47
47
 
48
- const core = new LivequeryClient({
48
+ const client = new LivequeryClient({
49
49
  endpoint: 'https://your-livequery-server'
50
50
  })
51
51
 
52
52
  export function AppProviders({ children }: { children: React.ReactNode }) {
53
53
  return (
54
- <LivequeryClientProvider core={core}>
54
+ <LivequeryClientProvider client={client}>
55
55
  {children}
56
56
  </LivequeryClientProvider>
57
57
  )
@@ -143,8 +143,8 @@ You can also pass a function when the observable should be resolved lazily.
143
143
  import { LivequeryClient } from '@livequery/client'
144
144
  import { useGlobalValue } from '@livequery/react'
145
145
 
146
- export function useAppCore() {
147
- return useGlobalValue('livequery-core', () => {
146
+ export function useAppClient() {
147
+ return useGlobalValue('livequery-client', () => {
148
148
  return new LivequeryClient({
149
149
  endpoint: 'https://your-livequery-server'
150
150
  })
@@ -0,0 +1,5 @@
1
+ import type { LivequeryClient } from "@livequery/client";
2
+ export declare const useLivequeryClient: () => LivequeryClient, LivequeryClientProvider: (props: import("react").PropsWithChildren<{
3
+ core: any;
4
+ }>) => import("react").JSX.Element;
5
+ //# sourceMappingURL=LivequeryClientContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LivequeryClientContext.d.ts","sourceRoot":"","sources":["../src/LivequeryClientContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGzD,eAAO,MAAO,kBAAkB,yBAAE,uBAAuB;UACrC,GAAG;kCACtB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { createContextFromHook } from "./createContextFromHook.js";
2
+ export const [useLivequeryClient, LivequeryClientProvider] = createContextFromHook((props) => props.core);
3
+ //# sourceMappingURL=LivequeryClientContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LivequeryClientContext.js","sourceRoot":"","sources":["../src/LivequeryClientContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE,uBAAuB,CAAC,GAAG,qBAAqB,CAC9E,CAAC,KAAoB,EAAE,EAAE,CAAC,KAAK,CAAC,IAAuB,CAC1D,CAAA"}
package/dist/index.d.ts CHANGED
@@ -2,6 +2,6 @@ export * from './createContextFromHook.js';
2
2
  export * from './useCollection.js';
3
3
  export * from './useDocument.js';
4
4
  export * from './useObservable.js';
5
- export * from './LivequeryCoreContext.js';
5
+ export * from './LivequeryClientContext.js';
6
6
  export * from './useAction.js';
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,2BAA2B,CAAA;AACzC,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gBAAgB,CAAA"}
package/dist/index.js CHANGED
@@ -2,6 +2,6 @@ export * from './createContextFromHook.js';
2
2
  export * from './useCollection.js';
3
3
  export * from './useDocument.js';
4
4
  export * from './useObservable.js';
5
- export * from './LivequeryCoreContext.js';
5
+ export * from './LivequeryClientContext.js';
6
6
  export * from './useAction.js';
7
7
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,2BAA2B,CAAA;AACzC,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gBAAgB,CAAA"}
@@ -1,17 +1,17 @@
1
1
  import { LivequeryCollection } from "@livequery/client";
2
2
  import { useMemo, useEffect } from "react";
3
- import { useLivequeryCore } from "./LivequeryCoreContext.js";
3
+ import { useLivequeryClient } from "./LivequeryClientContext.js";
4
4
  export const useCollection = (ref, options = {}) => {
5
- const core = useLivequeryCore();
6
- const collection = useMemo(() => new LivequeryCollection(core, options), []);
5
+ const client = useLivequeryClient();
6
+ const collection = useMemo(() => new LivequeryCollection(client, options), []);
7
7
  useEffect(() => {
8
- if (!ref || !core)
8
+ if (!ref || !client)
9
9
  return;
10
10
  const linker = collection.initialize(ref);
11
11
  return () => {
12
12
  linker?.unsubscribe();
13
13
  };
14
- }, [collection, core, ref]);
14
+ }, [collection, client, ref]);
15
15
  return collection;
16
16
  };
17
17
  //# sourceMappingURL=useCollection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCollection.js","sourceRoot":"","sources":["../src/useCollection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAA6C,MAAM,mBAAmB,CAAA;AAClG,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,2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AAG,CAAC,CAAA;QACzC,OAAO,GAAG,EAAE;YACR,MAAM,EAAE,WAAW,EAAE,CAAA;QACzB,CAAC,CAAA;IACL,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,CAAA;IAC7B,OAAO,UAAU,CAAA;AACrB,CAAC,CAAA"}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "url": "https://github.com/livequery/react"
5
5
  },
6
6
  "type": "module",
7
- "version": "2.0.105",
7
+ "version": "2.0.107",
8
8
  "description": "",
9
9
  "main": "./dist/index.js",
10
10
  "types": "./dist/index.d.ts",
@@ -19,10 +19,10 @@
19
19
  "import": "./dist/createContextFromHook.js",
20
20
  "default": "./dist/createContextFromHook.js"
21
21
  },
22
- "./LivequeryCoreContext": {
23
- "types": "./dist/LivequeryCoreContext.d.ts",
24
- "import": "./dist/LivequeryCoreContext.js",
25
- "default": "./dist/LivequeryCoreContext.js"
22
+ "./LivequeryClientContext": {
23
+ "types": "./dist/LivequeryClientContext.d.ts",
24
+ "import": "./dist/LivequeryClientContext.js",
25
+ "default": "./dist/LivequeryClientContext.js"
26
26
  },
27
27
  "./useAction": {
28
28
  "types": "./dist/useAction.d.ts",
@@ -52,7 +52,7 @@
52
52
  "@types/react": "^19.2.14"
53
53
  },
54
54
  "peerDependencies": {
55
- "@livequery/client": "^2.0.105",
55
+ "@livequery/client": "^2.0.106",
56
56
  "rxjs": "^7.8.2",
57
57
  "react": "^19.2.5"
58
58
  },
@@ -1,5 +0,0 @@
1
- import type { LivequeryClient } from "@livequery/client";
2
- export declare const useLivequeryCore: () => LivequeryClient, LivequeryCoreProvider: (props: import("react").PropsWithChildren<{
3
- core: any;
4
- }>) => import("react").JSX.Element;
5
- //# sourceMappingURL=LivequeryCoreContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LivequeryCoreContext.d.ts","sourceRoot":"","sources":["../src/LivequeryCoreContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGzD,eAAO,MAAO,gBAAgB,yBAAE,qBAAqB;UACjC,GAAG;kCACtB,CAAA"}
@@ -1,3 +0,0 @@
1
- import { createContextFromHook } from "./createContextFromHook.js";
2
- export const [useLivequeryCore, LivequeryCoreProvider] = createContextFromHook((props) => props.core);
3
- //# sourceMappingURL=LivequeryCoreContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LivequeryCoreContext.js","sourceRoot":"","sources":["../src/LivequeryCoreContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,GAAG,qBAAqB,CAC1E,CAAC,KAAoB,EAAE,EAAE,CAAC,KAAK,CAAC,IAAuB,CAC1D,CAAA"}