Comments (4)
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.
from neodigm55.
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.
if(this.fOnBeforeOpen[ _sId]) bOkOpen = this.fOnBeforeOpen[ _sId]( this.sId ) // The specific can cancel the generic
if( bOkOpen && this.fOnBeforeOpen["def"]) bOkOpen = this.fOnBeforeOpen["def"]( this.sId )
from neodigm55.
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.
let bOkClose = true // CBs must explicitly return false to prevent closing
if( this.fOnClose[ sId ] ) bOkClose = !(this.fOnClose[ sId ]( sId ) === false) // The specific can cancel the generic
if( bOkClose && this.fOnClose["def"] ) bOkClose = !(this.fOnClose["def"]( sId ) === false)
if( bOkClose ){
// stuff
}
from neodigm55.
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.
from neodigm55.
Related Issues (20)
- Robin Theme (utils) should not fire on GHOST themed elements HOT 1
- Neodigm Carousel | Animation Jank when init fires and an instance is embedded in another instance HOT 3
- Promote Release Candidate 2.6 HOT 1
- Neodigm Carousel | Add optional Named Panels (pages) HOT 1
- Wiki Recipe | Sort by Component HOT 1
- Neodigm Utils | Shake HOT 2
- Neodigm Utils | Generate Hash function - Simple, deterministic, unique hash value given a string. HOT 1
- Neodigm ActIcon | Decl Tulip not firing | The API does work via JS HOT 2
- Neodigm Tulip | Ghost Marquee text on the Light (ampm) gray (negative) shadow is difficult to read HOT 1
- Neodigm Wired4Sound | Improve generated sound options (24) HOT 1
- Neodigm Wired4Sound | Expose methods to better control volume. HOT 2
- Neodigm Soda Pop | Add Statefull Iconification HOT 3
- Neodigm Carousel | Named Regions (unique string representing an instance of a region or page) HOT 2
- Neodigm Tulip | Grandfather element declarative issue HOT 2
- Neodigm Enchanted CTA | Border visual artifact on top or bottom of buttons is a defect HOT 1
- All Components | Standardize data attrib -hover (no more mouseenter or mouseover) HOT 1
- All Components | Retire srcElement logic HOT 2
- Neodigm PopTart | Specific On Close Life Cycle Callback not working HOT 1
- Neodigm Poptart | Optional Hover dismiss behavior - Closed when mouse is off both bound element and Poptart HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neodigm55.