-
-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added suspending for rendering #23
base: master
Are you sure you want to change the base?
Conversation
You need to fix the lint errors. Run |
index.js
Outdated
return task.shouldSuspendUpdateRenderer(); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this logic belongs in listr
and not the renderer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After writing the tests, i remove it to listr
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic has been removed to listr with the commit 4685274.
This PR needs to add a test to prove it works correctly. |
index.js
Outdated
@@ -44,8 +44,19 @@ const renderHelper = (tasks, options, level) => { | |||
return output.join('\n'); | |||
}; | |||
|
|||
const shouldSuspendUpdateRenderer = tasks => { | |||
for (const task of tasks) { | |||
if (task.shouldSuspendUpdateRenderer()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use tasks.some()
here to simplify the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
In order to fix issue np issue 79 these changes suspend the update-process, if the task set a suspend flag.