Skip to content
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

Do not throw if a progress is less than last value #9

Merged
merged 3 commits into from
Feb 21, 2020

Conversation

timlesallen
Copy link
Contributor

@timlesallen timlesallen commented Feb 7, 2020

Since you can't guarantee that async stuff will evaluate in order, it's conceivable that event handlers may be evaluated out of order (I've noticed this in a browser after tabbing away and coming back.)

Fixes #8

@revelt
Copy link

revelt commented Feb 7, 2020

Algorithm does make sense and that was what came to my mind too. I'm thinking, API-wise, if somebody needs strict, current behaviour, in the future, we could always add a new options' setting, something like opts.strict or opts.noLesserReportedValues? Although it's hard to imagine, after all this program is just for progress reporting, it's not mission-critical... So what if some percentages will move slower at some point...

@sindresorhus sindresorhus changed the title Do not throw if a progress is less than last value. Do not throw if a progress is less than last value Feb 16, 2020
@sindresorhus
Copy link
Owner

Can you also document this new behavior in the readme? I think it's good to be explicit about it that p-progress only passes the progress values you supply through. It doesn't enforce it to be higher than the last.

Same text in https://github.com/sindresorhus/p-progress/blob/master/index.d.ts too.

@timlesallen
Copy link
Contributor Author

Can you also document this new behavior in the readme? I think it's good to be explicit about it that p-progress only passes the progress values you supply through. It doesn't enforce it to be higher than the last.

Same text in https://github.com/sindresorhus/p-progress/blob/master/index.d.ts too.

Will do.

@timlesallen
Copy link
Contributor Author

@sindresorhus Back to you.

@sindresorhus sindresorhus merged commit 33535c8 into sindresorhus:master Feb 21, 2020
@sindresorhus
Copy link
Owner

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reported percentage is lower than the last
3 participants