(input: string, state: State)
| 229 | } |
| 230 | |
| 231 | function defaultProcessor(input: string, state: State) { |
| 232 | const beforeCursor = state.value.slice(0, state.cursor) |
| 233 | const afterCursor = state.value.slice(state.cursor) |
| 234 | const value = `${beforeCursor}${input}${afterCursor}` |
| 235 | const cursor = state.cursor + input.length |
| 236 | return Effect.succeed( |
| 237 | Action.NextFrame({ |
| 238 | state: { ...state, cursor, value, error: Option.none() } |
| 239 | }) |
| 240 | ) |
| 241 | } |
| 242 | |
| 243 | const initialState: State = { |
| 244 | cursor: 0, |