-
-
Notifications
You must be signed in to change notification settings - Fork 257
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
Remove simple alias for wait
-> settled
.
#317
Conversation
@deprecated | ||
@returns {Promise<void>} resolves when settled | ||
*/ | ||
export default function settled() { |
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 this should be called wait()
, not settled()
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.
DOH! Indeed!
@returns {Promise<void>} resolves when settled | ||
*/ | ||
export default function settled() { | ||
let options = arguments[0]; |
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.
we should use function wait(options = {}) {
instead
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.
kk, seems good
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.
Hmm, actually its a tad different. The old 0.6.x wait
code avoided errors when something like a number was passed in, if I use default arguments here it will only correct for undefined
specifically...
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.
sure, the logic to handle non-objects would likely still need to exists, but I think putting options = {}
in would still be good for documentation purposes
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.
updated
a58fbd9
to
b96d19c
Compare
The original goal of `settled` was to "rebrand" `wait` as `settled` without the 'baggage" (since `wait` had some legacy APIs that should not exist in `settled`). Unfortunately, the code refactoring that I had originally done that allowed them to be shared resulted in introducing bugs like those reported. This commit completely severs the implementation of `wait` from that of `settled`, by leveraging the (IMHO very nice) layers of abstraction that we have created since the original extraction. Implementing `wait` with `waitUntil` and `getSettledState` makes this quite trivial now. tldr of changes: * `isSettled` no longer has to support the legacy `wait` contract (this was undocumented private behavior _only_ kept around to support the old semantics of `wait`) * `wait` is implemented as its own `waitUntil` with the same semantics it has had since the 0.6.x series
b96d19c
to
8bb08cc
Compare
The original goal of
settled
was to "rebrand"wait
assettled
without the 'baggage" (sincewait
had some legacy APIs that should not exist insettled
). Unfortunately, the code refactoring that I had originally done that allowed them to be shared resulted in introducing bugs like those reported in #283.This commit completely severs the implementation of
wait
from that ofsettled
, by leveraging the (IMHO very nice) layers of abstraction that we have created since the original extraction. Implementingwait
withwaitUntil
andgetSettledState
makes this quite trivial now.tldr of changes:
isSettled
no longer has to support the legacywait
contract (this was undocumented private behavior only kept around to support the old semantics ofwait
)wait
is implemented as its ownwaitUntil
with the same semantics it has had since the 0.6.x seriesFixes #300
Fixes #283
Closes #303