import { useMemo } from 'react' ; import type { ITaskMonitorConfig } from '@spinnaker/core' ; import { TaskMonitor } from '@spinnaker/core' ; param config param dismissModal export const useTaskMonitor = ( config , dismissModal ) => { const modalInstance = TaskMonitor . modalInstanceEmulation ( ( ) => dismissModal ( ) ) ; return useMemo ( ( ) => new TaskMonitor ( { modalInstance , ... config } ) , [ config . application , config . title ] ) ; } ;