11.14.0 (2024-09-09)
Fire global events that could be subscribed to (#2760)
Now you can do this:
// event handlers
Swal.on('didRender', (popup) => ...)
Swal.on('willOpen', (popup) => ...)
Swal.on('didOpen', (popup) => ...)
Swal.on('willClose', (popup) => ...)
Swal.on('didClose', () => ...)
Swal.on('didDestroy', () => ...)
// event handlers that will be executed at most once
Swal.once('didRender', (popup) => ...)
Swal.once('willOpen', (popup) => ...)
Swal.once('didOpen', (popup) => ...)
Swal.once('willClose', (popup) => ...)
Swal.once('didClose', () => ...)
Swal.once('didDestroy', () => ...)
Kudos to @getify for requesting and participation in implementing this feature ❤️