-
Notifications
You must be signed in to change notification settings - Fork 2
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
Neodigm SodaPop | Life Cycle Events #79
Comments
Why -- This is important from a DX perspective because SodaPop is usually the first component learned. Would suck if a dev had to unlearn it, in order to use the more modern components. So, yes this is a retrofit, but I would not say its breaking. |
Regarding OnBeforeOpen: If the specific CB (has id) returns false (canceling open) then the DEF will not fire. The prevents the generic DEF from canceling out an explicit cancelation.
|
Breaking - Backward Compatibility | To support backward compatibility and, I think make the Life Cycle callbacks more forgiving; On Before Open and On Close simply requires a specific FALSE (===) to cancel. Not falsey - undefined - 0 - empty string. If legacy implementation callback returns an UNDEFINED (which is pretty common) it will not stop the Soda Pop or Pop Tart instance from closing / opening. This made for some awkward code, but pays off in our commitment to DX.
|
This is fixed in v3.0. We now have a standard interface contract for dealing with component life cycle events. Each component may handle it a bit differently, but overall the contact should be rational. Documentation is going to be an on-going process, because the subject matter is advanced and applies to the entire framework. We should create a Life Cycle overview recipe and infographic, and one recipe for each component. |
This fix needs to be documented. The events behavior should be consistent for all components.
On Before Open - determines if open is allowed - Before DOM is appended
On After Open - determines when unhide (opacity) happens - After DOM is appended but before content is revealed.
On Close - determines if close is allowed - Before Close
The text was updated successfully, but these errors were encountered: