4087 refactor object metadata item hooks and utils (#4861)
- Extracted each exported element from useObjectMetadataItem into its own hook.
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import { useCallback } from 'react';
|
||||
import { useApolloClient } from '@apollo/client';
|
||||
|
||||
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
|
||||
import { CoreObjectNameSingular } from '@/object-metadata/types/CoreObjectNameSingular';
|
||||
import { useGetRecordFromCache } from '@/object-record/cache/hooks/useGetRecordFromCache';
|
||||
import { View } from '@/views/types/View';
|
||||
|
||||
export const useGetViewFromCache = () => {
|
||||
const client = useApolloClient();
|
||||
const cache = client.cache;
|
||||
|
||||
const { getRecordFromCache } = useObjectMetadataItem({
|
||||
const getRecordFromCache = useGetRecordFromCache({
|
||||
objectNameSingular: CoreObjectNameSingular.View,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user