reactfire 4.2.2 → 4.2.3-exp.4329c43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SuspenseSubject.d.ts +2 -1
- package/dist/auth.d.ts +5 -5
- package/dist/firestore.d.ts +2 -2
- package/dist/index.js +205 -205
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +5 -5
- package/dist/index.umd.cjs.map +1 -1
- package/dist/useObservable.d.ts +1 -1
- package/package.json +2 -2
- package/src/SuspenseSubject.ts +8 -2
- package/src/auth.tsx +7 -14
- package/src/firestore.tsx +2 -2
- package/src/useObservable.ts +5 -4
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Observable, Subject, Subscriber, Subscription } from 'rxjs';
|
|
2
2
|
export declare class SuspenseSubject<T> extends Subject<T> {
|
|
3
3
|
private _timeoutWindow;
|
|
4
|
+
private _suspenseEnabled;
|
|
4
5
|
private _value;
|
|
5
6
|
private _hasValue;
|
|
6
7
|
private _timeoutHandler;
|
|
@@ -10,7 +11,7 @@ export declare class SuspenseSubject<T> extends Subject<T> {
|
|
|
10
11
|
private _warmupSubscription;
|
|
11
12
|
private _innerSubscriber;
|
|
12
13
|
private _resolveFirstEmission;
|
|
13
|
-
constructor(innerObservable: Observable<T>, _timeoutWindow: number);
|
|
14
|
+
constructor(innerObservable: Observable<T>, _timeoutWindow: number, _suspenseEnabled: boolean);
|
|
14
15
|
get hasValue(): boolean;
|
|
15
16
|
get value(): T;
|
|
16
17
|
get firstEmission(): Promise<void>;
|
package/dist/auth.d.ts
CHANGED
|
@@ -73,20 +73,20 @@ export interface SignInCheckOptionsClaimsValidator extends SignInCheckOptionsBas
|
|
|
73
73
|
*
|
|
74
74
|
* ```ts
|
|
75
75
|
* // pass in an object describing the custom claims a user must have
|
|
76
|
-
* const {status, data: signInCheckResult} =
|
|
76
|
+
* const {status, data: signInCheckResult} = useSigninCheck({requiredClaims: {admin: true}});
|
|
77
77
|
*
|
|
78
78
|
* // pass in a custom claims validator function
|
|
79
|
-
* const {status, data: signInCheckResult} =
|
|
79
|
+
* const {status, data: signInCheckResult} = useSigninCheck({validateCustomClaims: (userClaims) => {
|
|
80
80
|
* // custom validation logic...
|
|
81
81
|
* }});
|
|
82
82
|
*
|
|
83
83
|
* // You can optionally force-refresh the token
|
|
84
|
-
* const {status, data: signInCheckResult} =
|
|
84
|
+
* const {status, data: signInCheckResult} = useSigninCheck({forceRefresh: true, requiredClaims: {admin: true}});
|
|
85
85
|
* ```
|
|
86
86
|
*/
|
|
87
87
|
export declare function useSigninCheck(options?: SignInCheckOptionsBasic | SignInCheckOptionsClaimsObject | SignInCheckOptionsClaimsValidator): ObservableStatus<SigninCheckResult>;
|
|
88
88
|
/**
|
|
89
|
-
* @deprecated Use `
|
|
89
|
+
* @deprecated Use `useSigninCheck` instead
|
|
90
90
|
*
|
|
91
91
|
* Conditionally render children based on [custom claims](https://firebase.google.com/docs/auth/admin/custom-claims).
|
|
92
92
|
*
|
|
@@ -94,7 +94,7 @@ export declare function useSigninCheck(options?: SignInCheckOptionsBasic | SignI
|
|
|
94
94
|
*/
|
|
95
95
|
export declare function ClaimsCheck({ user, fallback, children, requiredClaims }: ClaimsCheckProps): JSX.Element;
|
|
96
96
|
/**
|
|
97
|
-
* @deprecated Use `
|
|
97
|
+
* @deprecated Use `useSigninCheck` instead
|
|
98
98
|
*
|
|
99
99
|
* Conditionally render children based on signed-in status and [custom claims](https://firebase.google.com/docs/auth/admin/custom-claims).
|
|
100
100
|
*
|
package/dist/firestore.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { Query as FirestoreQuery, QuerySnapshot, DocumentReference, DocumentData
|
|
|
8
8
|
*/
|
|
9
9
|
export declare function preloadFirestoreDoc(refProvider: () => Promise<DocumentReference>): Promise<import("./SuspenseSubject").SuspenseSubject<DocumentSnapshot<DocumentData>>>;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Subscribe to Firestore Document changes
|
|
12
12
|
*
|
|
13
13
|
* You can preload data for this hook by calling `preloadFirestoreDoc`
|
|
14
14
|
*/
|
|
@@ -18,7 +18,7 @@ export declare function useFirestoreDoc<T = DocumentData>(ref: DocumentReference
|
|
|
18
18
|
*/
|
|
19
19
|
export declare function useFirestoreDocOnce<T = DocumentData>(ref: DocumentReference<T>, options?: ReactFireOptions<T>): ObservableStatus<DocumentSnapshot<T>>;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* Subscribe to Firestore Document changes and unwrap the document into a plain object
|
|
22
22
|
*/
|
|
23
23
|
export declare function useFirestoreDocData<T = unknown>(ref: DocumentReference<T>, options?: ReactFireOptions<T>): ObservableStatus<T>;
|
|
24
24
|
/**
|