Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(antd/transfer): transfer performance optimization while dataSourc… (
#39465) * fix(antd/transfer): transfer performance optimization while dataSource is large * fix(antd/transfer): unified function format of transKeys util file * fix(antd/transfer): transKeys Map Structure Adjustment
- Loading branch information
1 parent
af012df
commit f488cb8
Showing
3 changed files
with
30 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export const groupKeysMap = (keys: string[]) => { | ||
const map = new Map<string, number>(); | ||
keys.forEach((key, index) => { | ||
map.set(key, index); | ||
}); | ||
return map; | ||
}; | ||
export const groupDisabledKeysMap = <RecordType extends any[]>(dataSource: RecordType) => { | ||
const map = new Map<string, number>(); | ||
dataSource.forEach(({ disabled, key }, index) => { | ||
if (disabled) { | ||
map.set(key, index); | ||
} | ||
}); | ||
return map; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters