You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if we could dynamically make tasks visible or invisible. If invisible, they shouldn't be executed. So maybe the property should be called enabled instead? I had something in mind like
consttasks=newListr([{title: 'Install with yarn',task: ctx=>execa('yarn').catch(()=>{ctx.yarn=false;});},{title: 'Install with npm',visible: ctx=>ctx.yarn===false,task: ()=>execa('npm',['test'])}]);
The function should be synchronous because otherwise we could end up in a state where it looks like the tasks aren't doing any work for 5 seconds for instance.
While I'm typing this, I might be more in favour if enabled. As visible might look like the task is invisible but it will still be executed.
Any remarks, improvements or things I overlooked? Feel free to provide feedback.
From sindresorhus/np#114 (comment)
It would be nice if we could dynamically make tasks visible or invisible. If invisible, they shouldn't be executed. So maybe the property should be called
enabled
instead? I had something in mind likeThe function should be synchronous because otherwise we could end up in a state where it looks like the tasks aren't doing any work for 5 seconds for instance.
While I'm typing this, I might be more in favour if
enabled
. Asvisible
might look like the task is invisible but it will still be executed.Any remarks, improvements or things I overlooked? Feel free to provide feedback.
// @sindresorhus
The text was updated successfully, but these errors were encountered: