webscopeio/react-console

Implement history with reverse search

Closed this issue · 1 comments

The plan is to implement history & reverse search like in a regular console.

History proposal:

General:

  • Controlled-component-like history API via a new prop

API:

  • A single prop history
  • history prop is of type boolean | HistoryConfig, where HistoryConfig is
interface HistoryConfig {
  history: Array<string>,
  onCommand: (string) => void, 
}

Spec:

  • history prop contains ordered FIFO queue of previous commands
  • onCommand callback is triggered on every command submission, passes the new command as an argument