@triplit/react 0.0.15 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{useEffect as c,useState as u}from"react";function Q(e,i){let[n,s]=u(void 0),[l,r]=u(!1),t=i.build(),o=JSON.stringify(t);return c(()=>{r(!0);let y=e.subscribe(t,f=>{r(!1),s(f)});return()=>{y()}},[o,e]),{fetchingLocal:l,results:n,error:null}}export{Q as useQuery};
1
+ import{useEffect as y,useState as u}from"react";function d(e,s){let[i,n]=u(void 0),[l,t]=u(!1),r=s.build(),o=JSON.stringify(r);return y(()=>{t(!0);let f=e.subscribe(r,c=>{t(!1),n(c)});return()=>{f()}},[o,e]),{fetchingLocal:l,results:i,error:null}}export{d as useQuery};
@@ -1,6 +1,6 @@
1
- import { TriplitClient, ClientQuery, toBuilder } from '@triplit/client';
2
- export declare function useQuery<QueryBuilder extends toBuilder<ClientQuery<any>>>(client: TriplitClient<any>, query: QueryBuilder): {
1
+ import { QueryResults, TriplitClient, ClientQuery, toBuilder } from '@triplit/client';
2
+ export declare function useQuery<CQ extends ClientQuery<any>>(client: TriplitClient<any>, query: toBuilder<CQ>): {
3
3
  fetchingLocal: boolean;
4
- results: Map<string, import("db/src/schema").UnTimestampedObject<any>> | Map<string, never> | undefined;
4
+ results: QueryResults<CQ> | undefined;
5
5
  error: null;
6
6
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@triplit/react",
3
3
  "packageManager": "yarn@3.4.1",
4
- "version": "0.0.15",
4
+ "version": "0.0.16",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
7
7
  "type": "module",