Clean up model fetching and loading states

This commit is contained in:
Gregory Schier
2025-01-20 13:44:11 -08:00
parent 0453e84d38
commit 8ad7ac0bef
42 changed files with 180 additions and 247 deletions

View File

@@ -1,10 +1,4 @@
import type {
AnyModel,
Cookie,
GrpcConnection,
HttpResponse,
HttpResponseHeader,
} from '@yaakapp-internal/models';
import type { AnyModel, Cookie, HttpResponseHeader } from '@yaakapp-internal/models';
import { getMimeTypeFromContentType } from './contentType';
export const BODY_TYPE_NONE = null;
@@ -29,13 +23,6 @@ export function cookieDomain(cookie: Cookie): string {
return 'unknown';
}
export function isResponseLoading(
response: Pick<HttpResponse | GrpcConnection, 'state'> | null,
): boolean {
if (response == null) return false;
return response.state !== 'closed';
}
export function modelsEq(a: AnyModel, b: AnyModel) {
if (a.model != b.model) {
return false;