-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
[popups] Add onCloseComplete
callback
#1235
Conversation
Netlify deploy preview |
Naming:
|
|
let onClosedCalled = false; | ||
function notifyOnClosed() { | ||
onClosedCalled = true; | ||
} |
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.
let onClosedCalled = false; | |
function notifyOnClosed() { | |
onClosedCalled = true; | |
} | |
const notifyOnClosed = spy(); |
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.
Sinon's spy can be used instead (it can also verify if the function was called exactly once)
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.
This technique was already used for the existing animation tests, it'd probably be worth updating them all simultaneously in a separate PR
onClosed
callbackonCloseComplete
callback
Signed-off-by: atomiks <[email protected]>
A bit late to barge in
|
@vladmoroz I can see those points being valid, but reacting to close completing (when unmounting) requires this prop to exist, since you can't use |
I just think it's an odd API when one case is provided via a prop and a symmetrical one is fully DIY. Seems arbitrarily inflexible. I agree that it's a less common use case |
Alright, let me try to make a new PR that reuses the existing |
Closes #1208