Sets the subject for a specific element and moves to the next element
(index: number, subject: string)
| 226 | |
| 227 | /** Sets the subject for a specific element and moves to the next element */ |
| 228 | async function setElement(index: number, subject: string) { |
| 229 | elements[index] = subject; |
| 230 | setElements(elements); |
| 231 | if (index == elements.length - 1) { |
| 232 | addElement(index + 1); |
| 233 | } else { |
| 234 | focusElement(index + 1); |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | function moveElement(from: number, to: number) { |
| 239 | const element = elements[from]; |
no test coverage detected