Function
processCursorUp
(state: State, totalChoices: number)
Source from the content-addressed store, hash-verified
| 195 | } |
| 196 | |
| 197 | function processCursorUp(state: State, totalChoices: number) { |
| 198 | const newIndex = state.index === 0 ? totalChoices - 1 : state.index - 1 |
| 199 | return Effect.succeed(Action.NextFrame({ state: { ...state, index: newIndex } })) |
| 200 | } |
| 201 | |
| 202 | function processCursorDown(state: State, totalChoices: number) { |
| 203 | const newIndex = (state.index + 1) % totalChoices |
Tested by
no test coverage detected