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
Sort out instance and static methods #1373
Comments
zenflow
changed the title
Sort out instance and static methods for upcoming major
Sort out instance and static methods some day
Jan 19, 2019
Merged
limonte
changed the title
Sort out instance and static methods some day
Sort out instance and static methods
Jan 19, 2019
This looks like a feature request. In future please follow the templates when you reporting/requesting something to be done. This request is missing the "New feature motivation" section. Please describe the context, the use-case and the advantages of the feature request. What will change for end-users and why do they need this feature? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right now, for backwards compatibility, all instance methods are also exposed as static methods, via proxy methods defined here:
sweetalert2/src/SweetAlert.js
Lines 59 to 66 in 5efb897
We should
Swal.getTitle()
->swal.getTitle()
). Should make sure that calling these methods apply to that particular instance, and not the currently active swal, since they can be different. (Note: there are no instance methods that should become static methods)Swal.getCurrentInstance()
, which will be generally useful, and also allow for easy migration in situations where a user is using one of the methods that were changed to an instance method, but they didn't save a reference to the instanceThe text was updated successfully, but these errors were encountered: