diff options
author | crupest <crupest@outlook.com> | 2021-01-11 21:34:57 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-01-11 21:34:57 +0800 |
commit | 873bb613bc2deb86a4266bac160d14be265f9609 (patch) | |
tree | 00aeea22bfef21629a1004c174a88c931a47a5ca /FrontEnd/src/app/services/DataHub2.ts | |
parent | 1488919a75a67ad3992e9c66031c9079c50053f2 (diff) | |
download | timeline-873bb613bc2deb86a4266bac160d14be265f9609.tar.gz timeline-873bb613bc2deb86a4266bac160d14be265f9609.tar.bz2 timeline-873bb613bc2deb86a4266bac160d14be265f9609.zip |
...
Diffstat (limited to 'FrontEnd/src/app/services/DataHub2.ts')
-rw-r--r-- | FrontEnd/src/app/services/DataHub2.ts | 10 |
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> { |