Skip to content

Commit

Permalink
0.0.563
Browse files Browse the repository at this point in the history
  • Loading branch information
ivansglazunov committed Sep 23, 2024
1 parent 4cda5dd commit 360f3e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions imports/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2639,6 +2639,9 @@ export function useDeepQuery<Table extends 'links'|'numbers'|'strings'|'objects'
}, [q, o]);
const result = useQuery(wq?.query?.query, { variables: wq?.query?.variables, client: deep.apolloClient, ...o });
const [generated, setGenerated] = useState({ loading: true, data: [] });
useEffect(() => {
if (result.loading && !generated.loading) setGenerated({ data: generated.data, loading: result.loading });
}, [result.loading, generated]);
useEffect(() => {
if (o?.aggregate) setGenerated({ loading: false, data: (result)?.data?.q0?.aggregate?.[o.aggregate] });
else {
Expand Down Expand Up @@ -2712,6 +2715,9 @@ export function useDeepSubscription<Table extends 'links'|'numbers'|'strings'|'o
}, [q, o]);
const result = useSubscription(wq?.query?.query, { variables: wq?.query?.variables, client: deep.apolloClient, ...o });
const [generated, setGenerated] = useState({ loading: true, data: [] });
useEffect(() => {
if (result.loading && !generated.loading) setGenerated({ data: generated.data, loading: result.loading });
}, [result.loading, generated]);
useEffect(() => {
if (o?.aggregate) setGenerated({ loading: false, data: (result)?.data?.q0?.aggregate?.[o.aggregate] });
else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@deep-foundation/deeplinks",
"version": "0.0.562",
"version": "0.0.563",
"license": "Unlicense",
"type": "module",
"main": "import.js",
Expand Down

0 comments on commit 360f3e2

Please sign in to comment.