We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
.process.subscribe()
If I use the following code, questions are displayed properly (see the screenshot below):
var _ = require('lodash'); var inquirer = require('inquirer'); inquirer.prompt([ { type: 'list', name: 'questionA', message: 'Question A?', choices: ['Yes', 'No'], }, { type: 'list', name: 'questionB', message: 'Question B?', choices: ['Yes', 'No'], }, ])
However, if I use .process.subscribe(), it messes up the display a bit.
var _ = require('lodash'); var inquirer = require('inquirer'); inquirer.prompt([ { type: 'list', name: 'questionA', message: 'Question A?', choices: ['Yes', 'No'], }, { type: 'list', name: 'questionB', message: 'Question B?', choices: ['Yes', 'No'], }, ]) .process.subscribe(_.noop, _.noop, function () { console.log('Completed.'); });
I'm using version 0.9.0 with Node 0.12.7 on Mac.
Thanks.
The text was updated successfully, but these errors were encountered:
I'm getting the same issue with duplicate output
Possibly related: #209
Sorry, something went wrong.
Ok, I could reproduce this bug. Not sure what on rx.js side is breaking that flow. I'll investigate.
Well, the bug is pretty simple to find.
Basically when you add an extra listeners, each items in the array get processed again (this here is going to get called twice https://github.com/SBoudrias/Inquirer.js/blob/master/lib/ui/prompt.js#L61).
Gonna have to read RX documentation to see how to not rerun the whole process for each listeners... Pr welcomed.
96a2dd4
Successfully merging a pull request may close this issue.
If I use the following code, questions are displayed properly (see the screenshot below):
However, if I use
.process.subscribe()
, it messes up the display a bit.I'm using version 0.9.0 with Node 0.12.7 on Mac.
Thanks.
The text was updated successfully, but these errors were encountered: