Prevent a bunch more stuff from re-rendering

This commit is contained in:
Gregory Schier
2024-12-31 23:24:41 -08:00
parent dfca17f9b7
commit 80119f6574
13 changed files with 211 additions and 174 deletions

View File

@@ -1,7 +1,6 @@
import type { GrpcRequest, HttpRequest } from '@yaakapp-internal/models';
import { atom, useAtomValue } from 'jotai';
import {fallbackRequestName} from "../lib/fallbackRequestName";
import {jotaiStore} from "../lib/jotai";
import { jotaiStore } from '../lib/jotai';
import { activeRequestIdAtom } from './useActiveRequestId';
import { grpcRequestsAtom } from './useGrpcRequests';
import { httpRequestsAtom } from './useHttpRequests';
@@ -21,11 +20,6 @@ export function getActiveRequest() {
return jotaiStore.get(activeRequestAtom);
}
export const activeRequestNameAtom = atom(get => {
const activeRequest = get(activeRequestAtom);
return fallbackRequestName(activeRequest);
});
export function useActiveRequest<T extends keyof TypeMap>(
model?: T | undefined,
): TypeMap[T] | null {