What is better architectural solution for my own plugins to give ability to extend them — callbacks (like many other plugins do) or custom events?
What is better architectural solution for my own plugins to give ability to extend
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
IMO it is always better to use events in a plugin which is for the general public. But if you are looking for better performance and is a support plugin, rather than a standalone plugin, then it is always better to use callbacks (as there is no event bubbling emulated).
It is better to use jQuery.Callbacks (since v1.7) which is, as per the documentation:
rather than a custom callbacks handler.