@lunora/react 1.0.0-alpha.27 → 1.0.0-alpha.29

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,56 +0,0 @@
1
- 'use client';
2
- import { c } from 'react/compiler-runtime';
3
- import { useSyncExternalStore } from 'react';
4
- import { useLunora } from './LunoraProvider-BsuiW4Lk.mjs';
5
-
6
- const useClientQuery = (ref) => {
7
- const $ = c(11);
8
- const client = useLunora();
9
- let t0;
10
- let t1;
11
- let t2;
12
- if ($[0] !== client || $[1] !== ref) {
13
- t0 = (onStoreChange) => {
14
- const unsubscribe = client.subscribeClientQuery(ref, () => {
15
- onStoreChange();
16
- });
17
- return unsubscribe;
18
- };
19
- t1 = () => client.getClientQuery(ref);
20
- t2 = () => client.getClientQuery(ref);
21
- $[0] = client;
22
- $[1] = ref;
23
- $[2] = t0;
24
- $[3] = t1;
25
- $[4] = t2;
26
- } else {
27
- t0 = $[2];
28
- t1 = $[3];
29
- t2 = $[4];
30
- }
31
- const value = useSyncExternalStore(t0, t1, t2);
32
- let t3;
33
- if ($[5] !== client || $[6] !== ref) {
34
- t3 = (next) => {
35
- client.setClientQuery(ref, next);
36
- };
37
- $[5] = client;
38
- $[6] = ref;
39
- $[7] = t3;
40
- } else {
41
- t3 = $[7];
42
- }
43
- const setter = t3;
44
- let t4;
45
- if ($[8] !== setter || $[9] !== value) {
46
- t4 = [value, setter];
47
- $[8] = setter;
48
- $[9] = value;
49
- $[10] = t4;
50
- } else {
51
- t4 = $[10];
52
- }
53
- return t4;
54
- };
55
-
56
- export { useClientQuery as default };