SBoudrias / Inquirer.js

A collection of common interactive command line user interfaces.
MIT License
20.09k stars 1.3k forks source link

Refactor(@inquirer/core): Streamline exit handlers #1542

Closed SBoudrias closed 2 weeks ago

SBoudrias commented 3 weeks ago

Alternative answer to #1536.

2 challenges this code brings:

  1. Calling done from a hook cleanup can easily lead to an infinite loop (this code handles it, and there's a unit test covering this case already.)
  2. The cycle function becomes a bit more complex - might need to revisit this piece. Looked into extracting it out in #1543
mshima commented 2 weeks ago

Looks 👍 .