Code Monkey home page Code Monkey logo

Comments (4)

neodigm avatar neodigm commented on June 12, 2024 1

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.

neodigm avatar neodigm commented on June 12, 2024 1

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.

neodigm avatar neodigm commented on June 12, 2024 1

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.

neodigm avatar neodigm commented on June 12, 2024 1

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.