Skip to content

Commit

Permalink
0.0.538
Browse files Browse the repository at this point in the history
  • Loading branch information
ivansglazunov committed Sep 17, 2024
1 parent 7ebb361 commit a816076
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ services:
environment:
- 'NEXT_PUBLIC_GRAPHQL_URL=${NEXT_PUBLIC_GQL_PATH}'
- 'SECRET=${DEEPLINKS_HASURA_SECRET}'
- 'DEEPLINKS=${DEEPLINKS_PUBLIC_URL}'
- 'GQL=${NEXT_PUBLIC_GQL_PATH}'
- 'SSL=${NEXT_PUBLIC_GQL_SSL}'
logging:
driver: "json-file"
Expand Down
11 changes: 5 additions & 6 deletions imports/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,7 @@ export class DeepClient<L extends Link<Id> = Link<Id>> implements DeepClientInst
* Subscribes to data in the database
* @example
* ```
* deep.subscribe({ up: { link_id: deep.linkId } }).subscribe({ next: (links) => {}, error: (err) => {} });
* deep.subscribe({ up: { link_id: deep.linkId } }).subscribe({ next: ({ data: Link[], plainLinks?: Link[], originalData?: Link[] }) => {}, error: (err) => {} });
* ```
*/
subscribe<TTable extends 'links'|'numbers'|'strings'|'objects'|'can'|'selectors'|'tree'|'handlers', LL = L>(exp: Exp<TTable>, options?: ReadOptions<TTable>): Observable<DeepClientResult<LL[] | number>> {
Expand All @@ -1271,9 +1271,8 @@ export class DeepClient<L extends Link<Id> = Link<Id>> implements DeepClientInst
observer.name = name;
const subscription = apolloObservable.subscribe({
next: async (data: any) => {
const results = aggregate ? data?.data?.q0?.aggregate?.[aggregate] :
{
...(await this._generateResult(exp, options, data?.data?.q0)),
const results: any = {
data: (aggregate ? data?.data?.q0?.aggregate?.[aggregate] : (await this._generateResult(exp, options, data?.data?.q0))),
// @ts-ignore
return: exp?.return,
query: exp,
Expand Down Expand Up @@ -2910,7 +2909,7 @@ export type WriteOptions<TTable extends Table = 'links'> = Options<TTable> & {
containerId?: Id;
}

export const Subscription = memo(function Subscription({ query, options, interval, onChange }: any) {
export const Subscription = memo(function Subscription({ query, options, interval, onChange }: any): any {
const deep = useDeep();
const result: any = deep[interval ? 'useQuery' : 'useSubscription'](query, options);
useEffect(() => {
Expand All @@ -2936,7 +2935,7 @@ export const Subscription = memo(function Subscription({ query, options, interva
return null;
}, isEqual);

export const Query = memo(function Query({ query, options, onChange }: any) {
export const Query = memo(function Query({ query, options, onChange }: any): any {
const deep = useDeep();
const result: any = deep.useQuery(query, options);
if (result?.error?.message) console.error(result.error.message);
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.536",
"version": "0.0.538",
"license": "Unlicense",
"type": "module",
"main": "import.js",
Expand Down

0 comments on commit a816076

Please sign in to comment.