Skip to content

Commit

Permalink
Added staleTime constant
Browse files Browse the repository at this point in the history
  • Loading branch information
Savokr committed Jul 12, 2023
1 parent edd1420 commit 11fde8e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion react-components/src/hooks/useFdmAssetMappings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { type CogniteExternalId } from '@cognite/sdk';
import { useFdmSdk } from '../components/RevealContainer/SDKProvider';
import { type UseQueryResult, useQuery } from '@tanstack/react-query';
import { type FdmAssetMappingsConfig, type ThreeDModelMappings } from './types';
import { DEFAULT_QUERY_STALE_TIME } from '../utilities/constants';

const DefaultFdmConfig: FdmAssetMappingsConfig = {
source: {
Expand Down Expand Up @@ -83,6 +84,6 @@ export const useFdmAssetMappings = (

return modelMappingsTemp;
},
{ staleTime: 600000 }
{ staleTime: DEFAULT_QUERY_STALE_TIME }
);
};
1 change: 1 addition & 0 deletions react-components/src/utilities/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const DEFAULT_QUERY_STALE_TIME = 1000 * 60 * 10 ; // 10 minutes

0 comments on commit 11fde8e

Please sign in to comment.