-
-
Notifications
You must be signed in to change notification settings - Fork 271
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
Add ability to change text when stopping and persisting #35
Add ability to change text when stopping and persisting #35
Conversation
|
||
### .stopAndPersist([symbol]) | ||
### .stopAndPersist([symbol[, text]]) |
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.
Wondering if it's a better idea to use an options object here. Both symbol
and text
are optional and this way it's not possible to change the text
without providing the symbol
.
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.
Trying that out and it feels much nicer 👍
Stop the spinner, change it to `symbol` (or `' '` if `symbol` is not provided) and persist the `text`. Returns the instance. See the GIF below. | ||
Stop the spinner and change the symbol or text. Returns the instance. See the GIF below. | ||
|
||
If a string is provided, it is treated as a shortcut for [`options.symbol`](#symbol). |
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 think we should just remove the symbol
argument support (while still supporting it for backwards-compatibility).
|
||
##### options | ||
|
||
Type: `object` |
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.
object => Object
###### text | ||
|
||
Type: `string`<br> | ||
Default: current `text` |
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.
current => Current
###### symbol | ||
|
||
Type: `string`<br> | ||
Default: `' '` |
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 don't think the default is an empty string.
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.
The effective default is options.symbol || ' '
, or should we just say something like 'Clear the symbol'?
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.
Nah, it's good.
|
||
Stop the spinner, change it to a red `✖` and persist the `text`. Returns the instance. See the GIF below. | ||
Stop the spinner, change it to a red `✖` and persist `text` (or `.text` if `text` is not provided). Returns the instance. See the GIF below. |
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.
(or
.text
iftext
is not provided)
Not clear enough what this means. Would be better to just explain it. For example:
and persists the current text or
text
if provided.
} | ||
stopAndPersist(symbol) { | ||
stopAndPersist(options) { | ||
if (typeof options === 'string') { |
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.
Add a comment above here with the following:
// Legacy argument
// TODO: Deprecate sometime in the future
Looks great. Thank you :) |
Makes it more convenient to set a new past-tense message when stopping.
(Partial implementation of #28)