(state: ListState<T>, key: Key)
| 29 | >(); |
| 30 | |
| 31 | export function getRowId<T>(state: ListState<T>, key: Key): string { |
| 32 | let {id} = listMap.get(state) ?? {}; |
| 33 | if (!id) { |
| 34 | throw new Error('Unknown list'); |
| 35 | } |
| 36 | |
| 37 | return `${id}-${normalizeKey(key)}`; |
| 38 | } |
| 39 | |
| 40 | export function normalizeKey(key: Key): string { |
| 41 | if (typeof key === 'string') { |
no test coverage detected