mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
* refactor how we handle rpc responses and patchdb connection monitoring * websockets only * remove unused global error handlers * chore: clear storage inside auth service * feat: convert all global toasts to declarative approach (#1754) * no more reference to serverID Co-authored-by: Aiden McClelland <me@drbonez.dev> Co-authored-by: waterplea <alexander@inkin.ru>
17 lines
536 B
TypeScript
17 lines
536 B
TypeScript
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
|
import { PackageDataEntry } from 'src/app/services/patch-db/data-model'
|
|
import { filter, firstValueFrom } from 'rxjs'
|
|
|
|
export function getPackage(
|
|
patch: PatchDbService,
|
|
id: string,
|
|
): Promise<PackageDataEntry> {
|
|
return firstValueFrom(patch.watch$('package-data', id))
|
|
}
|
|
|
|
export function getAllPackages(
|
|
patch: PatchDbService,
|
|
): Promise<Record<string, PackageDataEntry>> {
|
|
return firstValueFrom(patch.watch$('package-data').pipe(filter(Boolean)))
|
|
}
|