• While developing my "Theme Setter" app, I had to implement a few additional concepts in order to overcome the limitations of the "layout" library.

    These concepts are:

    • "factory functions" - to be used instead of object literals - provide a more abstract and, thus, more comfortable way of describing individual components as they can hide details of their settings from the programmer
    • "common settings" may be defined (once) in form of an object literal and then provided as part of a control description in a (newly introduced) common attribute - the "factory functions" already take care of this attribute and use them as defaults. "Common settings" may be easily cascaded (by means of Object.assign) and overwritten in factory functions, if need be
    • "generic event dispatching" lets every control (even labels or vertical/horizontal layouts) react to any kind of event

    You will find a description (with examples) of these concepts on GitHub.

    Additionally, you may also just look into the source code of my "Theme Setter" in order to see all these concepts in a "real" application.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

layout library: factory functions, common settings, generic event dispatching

Posted by Avatar for Andreas_Rozek @Andreas_Rozek