@dereekb/dbx-firebase 9.5.3 → 9.5.4
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.
|
@@ -2722,7 +2722,7 @@ function firebaseDocumentStoreCreateFunction(store, fn) {
|
|
|
2722
2722
|
* @returns
|
|
2723
2723
|
*/
|
|
2724
2724
|
function firebaseDocumentStoreCrudFunction(fn) {
|
|
2725
|
-
return (params) => loadingStateFromObs(from(fn(params)));
|
|
2725
|
+
return (params) => loadingStateFromObs(from(fn(params)).pipe(shareReplay(1)));
|
|
2726
2726
|
}
|
|
2727
2727
|
// MARK: Update
|
|
2728
2728
|
/**
|
|
@@ -2735,10 +2735,10 @@ function firebaseDocumentStoreCrudFunction(fn) {
|
|
|
2735
2735
|
* @returns
|
|
2736
2736
|
*/
|
|
2737
2737
|
function firebaseDocumentStoreUpdateFunction(store, fn) {
|
|
2738
|
-
return (params) => loadingStateFromObs(store.key$.pipe(first(),
|
|
2738
|
+
return (params) => loadingStateFromObs(store.key$.pipe(first(), exhaustMap((key) => fn({
|
|
2739
2739
|
...params,
|
|
2740
2740
|
key // inject key into the parameters.
|
|
2741
|
-
}))));
|
|
2741
|
+
})), shareReplay(1)));
|
|
2742
2742
|
}
|
|
2743
2743
|
// MARK: Delete
|
|
2744
2744
|
/**
|
|
@@ -2751,13 +2751,13 @@ function firebaseDocumentStoreUpdateFunction(store, fn) {
|
|
|
2751
2751
|
* @returns
|
|
2752
2752
|
*/
|
|
2753
2753
|
function firebaseDocumentStoreDeleteFunction(store, fn) {
|
|
2754
|
-
return (params) => loadingStateFromObs(store.key$.pipe(first(),
|
|
2754
|
+
return (params) => loadingStateFromObs(store.key$.pipe(first(), exhaustMap((key) => fn({
|
|
2755
2755
|
...params,
|
|
2756
2756
|
key // inject key into the parameters.
|
|
2757
2757
|
}).then((result) => {
|
|
2758
2758
|
store.clearRefs();
|
|
2759
2759
|
return result;
|
|
2760
|
-
}))));
|
|
2760
|
+
})), shareReplay(1)));
|
|
2761
2761
|
}
|
|
2762
2762
|
|
|
2763
2763
|
function setParentStoreEffect(store) {
|