@dereekb/dbx-firebase 9.3.1 → 9.3.2

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.
@@ -43,6 +43,10 @@ export declare class DbxFirebaseCollectionChangeTriggerInstance<S extends DbxFir
43
43
  /**
44
44
  * Creates a new DbxFirebaseCollectionChangeWatcher, set the modes to "auto", and creates a new DbxFirebaseCollectionChangeTriggerInstance.
45
45
  *
46
+ * If no trigger function is provided it will default to resetting the store.
47
+ *
48
+ * NOTE: Don't forget to initialize the DbxFirebaseCollectionChangeTriggerInstance and handle other lifecycle changes.
49
+ *
46
50
  * @param store
47
51
  * @param triggerFunction
48
52
  * @returns
@@ -31,6 +31,7 @@ export declare class DbxFirebaseCollectionLoaderInstance<T = unknown, D extends
31
31
  readonly snapshotAccumulatorDocuments$: Observable<D[][]>;
32
32
  readonly accumulator$: Observable<FirebaseQueryItemAccumulator<T>>;
33
33
  readonly accumulatorItems$: Observable<DocumentDataWithIdAndKey<T>[][]>;
34
+ readonly hasDocuments$: Observable<boolean>;
34
35
  readonly allDocumentRefs$: Observable<DocumentReference<T>[]>;
35
36
  readonly allDocuments$: Observable<D[]>;
36
37
  readonly allDocumentData$: Observable<DocumentDataWithIdAndKey<T>[]>;
@@ -13,6 +13,10 @@ export interface DbxFirebaseCollectionStore<T, D extends FirestoreDocument<T> =
13
13
  readonly queryChangeWatcher$: Observable<IterationQueryDocChangeWatcher<T>>;
14
14
  readonly accumulator$: Observable<FirebaseQueryItemAccumulator<T>>;
15
15
  readonly pageLoadingState$: Observable<PageListLoadingState<DocumentDataWithIdAndKey<T>>>;
16
+ readonly hasDocuments$: Observable<boolean>;
17
+ readonly allDocumentRefs$: Observable<DocumentReference<T>[]>;
18
+ readonly allDocuments$: Observable<D[]>;
19
+ readonly allDocumentData$: Observable<DocumentDataWithIdAndKey<T>[]>;
16
20
  setMaxPages(observableOrValue: ObservableOrValue<Maybe<number>>): Subscription;
17
21
  setItemsPerPage(observableOrValue: ObservableOrValue<Maybe<number>>): Subscription;
18
22
  setConstraints(observableOrValue: ObservableOrValue<Maybe<ArrayOrValue<FirestoreQueryConstraint>>>): Subscription;
@@ -43,6 +47,7 @@ export declare class AbstractDbxFirebaseCollectionStore<T, D extends FirestoreDo
43
47
  readonly queryChangeWatcher$: Observable<IterationQueryDocChangeWatcher<T>>;
44
48
  readonly accumulator$: Observable<FirebaseQueryItemAccumulator<T>>;
45
49
  readonly pageLoadingState$: Observable<PageListLoadingState<DocumentDataWithIdAndKey<T>>>;
50
+ readonly hasDocuments$: Observable<boolean>;
46
51
  readonly allDocumentRefs$: Observable<DocumentReference<T>[]>;
47
52
  readonly allDocuments$: Observable<D[]>;
48
53
  readonly allDocumentData$: Observable<DocumentDataWithIdAndKey<T>[]>;
@@ -18,6 +18,7 @@ export interface DbxFirebaseDocumentStore<T, D extends FirestoreDocument<T> = Fi
18
18
  readonly id$: Observable<FirestoreModelId>;
19
19
  readonly key$: Observable<FirestoreModelKey>;
20
20
  readonly ref$: Observable<DocumentReference<T>>;
21
+ readonly hasRef$: Observable<boolean>;
21
22
  readonly keyModelIds$: Observable<FirestoreModelId[]>;
22
23
  readonly keyPairs$: Observable<FirestoreModelCollectionAndIdPair[]>;
23
24
  readonly keyPairObject$: Observable<FirestoreModelCollectionAndIdPairObject>;
@@ -27,6 +28,7 @@ export interface DbxFirebaseDocumentStore<T, D extends FirestoreDocument<T> = Fi
27
28
  readonly currentData$: Observable<Maybe<DocumentDataWithIdAndKey<T>>>;
28
29
  readonly data$: Observable<DocumentDataWithIdAndKey<T>>;
29
30
  readonly dataLoadingState$: Observable<LoadingState<DocumentDataWithIdAndKey<T>>>;
31
+ readonly currentExists$: Observable<boolean>;
30
32
  readonly exists$: Observable<boolean>;
31
33
  readonly modelIdentity$: Observable<FirestoreModelIdentity>;
32
34
  setId: (observableOrValue: ObservableOrValue<Maybe<FirestoreModelId>>) => Subscription;
@@ -67,6 +69,10 @@ export declare class AbstractDbxFirebaseDocumentStore<T, D extends FirestoreDocu
67
69
  readonly currentInputRef$: Observable<Maybe<DocumentReference<T>>>;
68
70
  readonly inputRef$: Observable<DocumentReference<T>>;
69
71
  readonly currentDocument$: Observable<Maybe<D>>;
72
+ /**
73
+ * Whether or not an id/ref/key has been input and currentDocument is not null.
74
+ */
75
+ readonly hasRef$: Observable<boolean>;
70
76
  readonly document$: Observable<D>;
71
77
  readonly documentLoadingState$: Observable<LoadingState<D>>;
72
78
  readonly id$: Observable<FirestoreModelId>;
@@ -80,6 +86,10 @@ export declare class AbstractDbxFirebaseDocumentStore<T, D extends FirestoreDocu
80
86
  readonly currentData$: Observable<Maybe<DocumentDataWithIdAndKey<T>>>;
81
87
  readonly data$: Observable<DocumentDataWithIdAndKey<T>>;
82
88
  readonly dataLoadingState$: Observable<LoadingState<DocumentDataWithIdAndKey<T>>>;
89
+ /**
90
+ * Returns false while hasRef$ is false, and then returns exists$.
91
+ */
92
+ readonly currentExists$: Observable<boolean>;
83
93
  readonly exists$: Observable<boolean>;
84
94
  readonly doesNotExist$: Observable<boolean>;
85
95
  readonly modelIdentity$: Observable<FirestoreModelIdentity>;
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-firebase",
3
- "version": "9.3.1",
3
+ "version": "9.3.2",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^14.0.0",
6
6
  "@angular/core": "^14.0.0",
7
- "@dereekb/util": "9.3.1",
7
+ "@dereekb/util": "9.3.2",
8
8
  "firebase": "^9.9.2",
9
9
  "rxjs": "^7.5.0",
10
10
  "@angular/fire": "^7.4.1",
11
- "@dereekb/firebase": "9.3.1",
12
- "@dereekb/dbx-core": "9.3.1",
11
+ "@dereekb/firebase": "9.3.2",
12
+ "@dereekb/dbx-core": "9.3.2",
13
13
  "@angular/material": "^14.0.0",
14
- "@dereekb/dbx-web": "9.3.1",
15
- "@dereekb/dbx-form": "9.3.1"
14
+ "@dereekb/dbx-web": "9.3.2",
15
+ "@dereekb/dbx-form": "9.3.2"
16
16
  },
17
17
  "dependencies": {
18
18
  "tslib": "^2.3.0"