Skip to content

Commit

Permalink
docs(@leav/ui): move comment to JSDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
P0ppoff committed Oct 31, 2024
1 parent 06d8c26 commit 2d48147
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion libs/ui/src/components/Explorer/useDeactivateAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ import {useDeactivateRecordsMutation} from '_ui/_gqlTypes';
import {useSharedTranslation} from '_ui/hooks/useSharedTranslation';
import {DataGroupedFilteredSorted, ItemActions} from './types';

/**
* Hook used to get the action for `<DataView />` component.
*
* When the mutation for deactivation is done, the Apollo cache will be clean (`Record` and `RecordIdentity`)
* from deactivated record.
*
* @param isEnabled - whether the action is present
*/
export const useDeactivateAction = (isEnabled: boolean) => {
const {t} = useSharedTranslation();

Expand All @@ -17,7 +25,7 @@ export const useDeactivateAction = (isEnabled: boolean) => {
id: cache.identify(record)
});
});
cache.gc(); // used to delete RecordIdentity too
cache.gc();
}
});

Expand Down

0 comments on commit 2d48147

Please sign in to comment.