Skip to content

Commit

Permalink
Chore(@inquirer/core): Prune some useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
SBoudrias committed Jun 19, 2024
1 parent bafa0de commit eccb5c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/core/src/lib/create-prompt.mts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,8 @@ export function createPrompt<Value, Config>(view: ViewFunction<Value, Config>) {
});
}

function workLoop(resolvedConfig: Config) {
function workLoop() {
store.index = 0;
store.handleChange = () => workLoop(resolvedConfig);

try {
const nextView = view(config, done);
Expand All @@ -95,7 +94,8 @@ export function createPrompt<Value, Config>(view: ViewFunction<Value, Config>) {
}
}

workLoop(config);
store.handleChange = () => workLoop();
workLoop();

// Re-renders only happen when the state change; but the readline cursor could change position
// and that also requires a re-render (and a manual one because we mute the streams).
Expand Down

0 comments on commit eccb5c8

Please sign in to comment.