bvaughn/progress-estimator

Suggestion: return configurator, not mutate semi-globals

AndrewRayCode opened this issue · 6 comments

Your configure() code mutates some semi-global variables. It would be nicer for the end consumer to have the creation function return a new object bound to its own options, to potentially use more than one

I actually intentionally chose the global mutation option because it seemed a bit more convenient. Didn't seem like people would want multiple, independent instances of this utility. Can you describe what kind of use case you're thinking about that would actually use this?

@bvaughn Sorry for posting it here, but what is that shell you're using in the README? I could use something like that.

It's Oh My Zsh with the Dracula theme.

I actually intentionally chose the global mutation option because it seemed a bit more convenient. Didn't seem like people would want multiple, independent instances of this utility. Can you describe what kind of use case you're thinking about that would actually use this?

A simple use case would be with listr where you can have multiple long tasks running and their statuses being tracked and displayed in parallel. See also #6 and #7

But yes, it's unlikely that the parallel tasks would use different storagePath as their states are tracked in files under this path (it's a directory). They could potentially use a different theme to color different tasks differently. Using a different spinner shape is unlikely.

Implemented in 8775409. Will be released shortly with 0.2.0