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
I set prefixText like this:
prefixText
spinner.prefixText = 'Loading'; spinner.spinner = 'simpleDots'; spinner.start(); ... spinner.stop();
Then, I set prefixText to an empty string and reuse the spinner:
spinner
spinner.prefixText = ''; spinner.spinner = 'dots'; spinner.start();
This time, before the spinner symbol, there's one undesirable space.
The cause is this code in the frame method (https://github.com/sindresorhus/ora/blob/master/index.js#L119):
frame
const fullPrefixText = typeof this.prefixText === 'string' ? this.prefixText + ' ' : '';
Initially, prefixText is undefined so the code worked. But after it's set to an empty string, it doesn't work as expected.
undefined
I'm using TypeScript. Setting like this will cause syntax error (https://github.com/sindresorhus/ora/blob/master/index.d.ts#L127):
spinner.prefixText = undefined;
I have to do like this (not very nice):
this.spinner.prefixText = undefined as any;
The text was updated successfully, but these errors were encountered:
// @stroncium
Sorry, something went wrong.
solves sindresorhus#122
892346e
If we check for empty string here, it will be impossible to maintain consistent behavior(which is having the space). So, the options are:
Implemented 2nd option for now.
@sindresorhus
Successfully merging a pull request may close this issue.
I set
prefixText
like this:Then, I set
prefixText
to an empty string and reuse thespinner
:This time, before the spinner symbol, there's one undesirable space.
The cause is this code in the
frame
method (https://github.com/sindresorhus/ora/blob/master/index.js#L119):Initially,
prefixText
isundefined
so the code worked. But after it's set to an empty string, it doesn't work as expected.I'm using TypeScript. Setting like this will cause syntax error (https://github.com/sindresorhus/ora/blob/master/index.d.ts#L127):
I have to do like this (not very nice):
The text was updated successfully, but these errors were encountered: