aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/app/services/DataHub2.ts
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-01-11 21:34:57 +0800
committercrupest <crupest@outlook.com>2021-01-11 21:34:57 +0800
commite4c96126ef3cb70fce3dec7244f0eb368f64db37 (patch)
treefd5e71c1bf306d9daac86f71226cabf164994018 /FrontEnd/src/app/services/DataHub2.ts
parentab89e1fccad60deabafb24d08398b3efadbe3cd8 (diff)
downloadtimeline-e4c96126ef3cb70fce3dec7244f0eb368f64db37.tar.gz
timeline-e4c96126ef3cb70fce3dec7244f0eb368f64db37.tar.bz2
timeline-e4c96126ef3cb70fce3dec7244f0eb368f64db37.zip
...
Diffstat (limited to 'FrontEnd/src/app/services/DataHub2.ts')
-rw-r--r--FrontEnd/src/app/services/DataHub2.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/FrontEnd/src/app/services/DataHub2.ts b/FrontEnd/src/app/services/DataHub2.ts
index 88849da3..50ae919b 100644
--- a/FrontEnd/src/app/services/DataHub2.ts
+++ b/FrontEnd/src/app/services/DataHub2.ts
@@ -2,6 +2,16 @@ import { Observable } from "rxjs";
export type DataStatus = "syncing" | "synced" | "offline";
+export function mergeDataStatus(statusList: DataStatus[]): DataStatus {
+ if (statusList.includes("offline")) {
+ return "offline";
+ } else if (statusList.includes("syncing")) {
+ return "syncing";
+ } else {
+ return "synced";
+ }
+}
+
export type Subscriber<TData> = (data: TData) => void;
export interface DataAndStatus<TData> {