theckman / yacspin

Yet Another CLi Spinner; providing over 80 easy to use and customizable terminal spinners for multiple OSes
Apache License 2.0
434 stars 13 forks source link

Add ability to pause spinner and get its status #19

Closed theckman closed 4 years ago

theckman commented 4 years ago

This change adds three new methods to the Spinner type, and deprecates the Active method.

The first are the Pause() and Unpause() methods, which put the spinner in a paused state so that you can update multiple configuration options without users seeing a spinner rendered with partial changes applied. Such as changing the suffix, message, or colors.

The third method is the Status() method, which deprecates Active(). Because the internal state machine for the spinner has become more complex, it's no longer reasonable to consider it active or inactive. With this we include a new type, SpinnerStatus, and constants to represent each state of the internal state machine:

codecov[bot] commented 4 years ago

Codecov Report

Merging #19 into master will increase coverage by 0.42%. The diff coverage is 89.09%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #19      +/-   ##
==========================================
+ Coverage   92.05%   92.48%   +0.42%     
==========================================
  Files           2        2              
  Lines         340      386      +46     
==========================================
+ Hits          313      357      +44     
- Misses         14       15       +1     
- Partials       13       14       +1     
Impacted Files Coverage Δ
spinner.go 92.24% <89.09%> (+0.47%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7238def...7523c7c. Read the comment docs.