@triplit/react 0.0.14 → 0.0.15
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 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};
|
package/dist/use-query.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
import {
|
2
|
-
export declare function useQuery<
|
1
|
+
import { TriplitClient, ClientQuery, toBuilder } from '@triplit/client';
|
2
|
+
export declare function useQuery<QueryBuilder extends toBuilder<ClientQuery<any>>>(client: TriplitClient<any>, query: QueryBuilder): {
|
3
3
|
fetchingLocal: boolean;
|
4
|
-
results:
|
4
|
+
results: Map<string, import("db/src/schema").UnTimestampedObject<any>> | Map<string, never> | undefined;
|
5
5
|
error: null;
|
6
6
|
};
|