import { WorkspaceSubscriptionNanoWaitingEventRecord } from '../../../../../../../../server-services/query-records/workspace-records';
import { waitingNanosQuery } from '../../../../../../../../server-services/querys';
import { WorkspaceChangeSubscriptionSpecificHandler } from '../types';

export let onDeleteNanoWaitinEventSubscriptionHandler: WorkspaceChangeSubscriptionSpecificHandler =
  (cache, event: WorkspaceSubscriptionNanoWaitingEventRecord) => {
    delete cache.getCacheDataByRequest({ query: waitingNanosQuery, variables: {} })[event.waiterId];
  };
