gongo-client-react
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -10,4 +10,4 @@ import { Database, Cursor } from "gongo-client"; | ||
declare const useGongoOne: <DocType extends Document>(origCursorFunc: false | "" | CursorFunc<DocType> | null | undefined, opts?: useGongoCursorOpts) => import("gongo-client/lib/browser/Collection").WithId<DocType> | null; | ||
declare function useGongoUserId(): unknown; | ||
declare function useGongoUserId(): string | null; | ||
export { useGongoCursor, useGongoLive, useGongoOne, useGongoUserId }; | ||
//# sourceMappingURL=liveQueries.d.ts.map |
@@ -78,4 +78,6 @@ "use strict"; | ||
const data = useGongoLive(cursorFunc /*, opts */); | ||
return data[0] && data[0].userId; | ||
if (!(data && data[0])) | ||
return null; | ||
return data[0].userId; | ||
} | ||
exports.useGongoUserId = useGongoUserId; |
import { Collection, Database } from "gongo-client"; | ||
import type { Document } from "gongo-client/lib/browser/Collection"; | ||
import type { SubscriptionArguments, SubscriptionOptions } from "gongo-client/lib/browser/Subscription"; | ||
declare function useGongoSub(name: string, args?: SubscriptionArguments, opts?: SubscriptionOptions): "" | import("gongo-client/lib/browser/Subscription").default; | ||
declare function useGongoSub(name: string | null | undefined | false, args?: SubscriptionArguments, opts?: SubscriptionOptions): false | "" | import("gongo-client/lib/browser/Subscription").default | null | undefined; | ||
declare function useGongoIsPopulated(collOrCollNameOrDatabase?: string | Database | Collection<Document>): boolean; | ||
@@ -6,0 +6,0 @@ declare function IsPopulated(...args: unknown[]): void; |
{ | ||
"name": "gongo-client-react", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"author": "Gadi Cohen <dragon@wastelands.net>", | ||
@@ -5,0 +5,0 @@ "description": "React hooks for GongoJS gongo-client", |
@@ -109,5 +109,6 @@ import { useState, useEffect, useMemo } from "react"; | ||
const data = useGongoLive(cursorFunc /*, opts */); | ||
return data[0] && data[0].userId; | ||
if (!(data && data[0])) return null; | ||
return data[0].userId as string; | ||
} | ||
export { useGongoCursor, useGongoLive, useGongoOne, useGongoUserId }; |
@@ -12,3 +12,3 @@ import { useState, useEffect } from "react"; | ||
function useGongoSub( | ||
name: string, | ||
name: string | null | undefined | false, | ||
args?: SubscriptionArguments, | ||
@@ -15,0 +15,0 @@ opts?: SubscriptionOptions |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36341
693