refactor: clarify frontend model ownership
This commit is contained in:
@@ -13,6 +13,7 @@ export { ApiErrorCode, apiErrorCode, isApiErrorCode } from "./problem-details";
|
||||
|
||||
export {
|
||||
invalidateResourceAccess,
|
||||
type InvestmentResourceMeta,
|
||||
unwrapResourceResult,
|
||||
useResourceQuery,
|
||||
} from "./resource-query";
|
||||
|
||||
@@ -16,9 +16,11 @@ import { ApiErrorCode, apiErrorCode, isApiErrorCode } from "./problem-details";
|
||||
|
||||
const accessEpochs = new WeakMap<QueryClient, Map<string, number>>();
|
||||
|
||||
type InvestmentResourceMeta = components["schemas"]["InvestmentResourceMetaDto"];
|
||||
|
||||
type Resource = {
|
||||
data: unknown;
|
||||
meta: components["schemas"]["InvestmentResourceMetaDto"];
|
||||
meta: InvestmentResourceMeta;
|
||||
};
|
||||
|
||||
function invalidateResourceAccess(
|
||||
@@ -183,4 +185,9 @@ function useResourceQuery<T extends Resource, E, K extends QueryKey>(
|
||||
};
|
||||
}
|
||||
|
||||
export { invalidateResourceAccess, unwrapResourceResult, useResourceQuery };
|
||||
export {
|
||||
invalidateResourceAccess,
|
||||
type InvestmentResourceMeta,
|
||||
unwrapResourceResult,
|
||||
useResourceQuery,
|
||||
};
|
||||
|
||||
@@ -8,4 +8,3 @@ export {
|
||||
formatSnapshotTime,
|
||||
instrumentLogoUrl,
|
||||
} from "./display";
|
||||
export { useImageFallback } from "./useImageFallback";
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
import { useState } from "react";
|
||||
|
||||
function useImageFallback() {
|
||||
const [failed, setFailed] = useState(false);
|
||||
const onError = () => setFailed(true);
|
||||
|
||||
return { failed, onError };
|
||||
}
|
||||
|
||||
export { useImageFallback };
|
||||
Reference in New Issue
Block a user