Remove unused components (#1180)
* Remove unused components * Fix company not being created issue * Fix company not being created issue * Fix company not being created issue * Optimize rendering * Optimize rendering
This commit is contained in:
19
front/src/modules/ui/table/hooks/useSetTableRowIds.ts
Normal file
19
front/src/modules/ui/table/hooks/useSetTableRowIds.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { useRecoilCallback } from 'recoil';
|
||||
|
||||
import { tableRowIdsState } from '../states/tableRowIdsState';
|
||||
|
||||
export function useSetTableRowIds() {
|
||||
return useRecoilCallback(
|
||||
({ set, snapshot }) =>
|
||||
(rowIds: string[]) => {
|
||||
const currentRowIds = snapshot
|
||||
.getLoadable(tableRowIdsState)
|
||||
.valueOrThrow();
|
||||
|
||||
if (JSON.stringify(rowIds) !== JSON.stringify(currentRowIds)) {
|
||||
set(tableRowIdsState, rowIds);
|
||||
}
|
||||
},
|
||||
[],
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user