@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 +1 -1
- package/dist/use-query.d.ts +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{useEffect as
|
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};
|
package/dist/use-query.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
import { TriplitClient, ClientQuery, toBuilder } from '@triplit/client';
|
2
|
-
export declare function useQuery<
|
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:
|
4
|
+
results: QueryResults<CQ> | undefined;
|
5
5
|
error: null;
|
6
6
|
};
|